Fixing this would probably require some changes at the language level, or at the module-loader level for some languages that use one.