I followed the guide on how to disable it but the reverse does not work:
Mage::getConfig()->setNode($nodePath, 'true', true);
I guess extensions are already loaded at that point?
Modules are loaded during bootstrap, in
Mage_Core_Model_App::loadModulesConfiguration(). If the path of
config/modules/Module_Name/active is set to
true at this point, then the modules
etc/config.xml file is loaded and the config contained within is merged in to the config structure in memory, so to disable the module you'd have to either set
active to false before this point (which would require a core change, as no event is dispatched prior to this point which would allow you to do so), or remove all the elements from the config that the modules config files contained before the module is used (which would be a bit of a challenge, so I'd not advise it).