Is there anyway to disable code optimization once?

I know some ways to disable code optimization, but they just work in modules. Is there anyway to turn off code optimization in all modules at once.