This patch adds a new macro to BLI_compiler_attrs.h, ATTR_NO_OPT, that disables optimization per-function, which can be very useful for debugging.
There are issues with this. I don't think it makes any sense to commit code with ATTR_NO_OPT in it. Since I keep finding myself forgetting to strip them all out before committing to my temp_multires_bmesh branch I propose that if this patch is accepted, a server-side commit hook be added to reject commits with ATTR_NO_OPT in them.
If this is not acceptable then I can write a client-side pre-commit hook to reject the compiler-specific forms of this attribute. This could then be posted to the wiki or committed to build_files/utils in the repo for other developers to use.