It is kinda impractical as it stands to do this. But I do wonder if it could be made part of the config. Basically the config normally knows whether it is loading compiled or dev modules, and the config is loaded before any modules, perhaps defaulting to off, but allowing a config to demand a global define be made available.