core: cache result of check if a specific module is enabled.