The module_load_all function loads all of the enabled modules. this is its code:
function module_load_all($bootstrap = FALSE) {
static $has_run = FALSE;
if (isset($bootstrap)) {
foreach (module_list(TRUE, $bootstrap) as $module) {
drupal_load('module', $module);
}
// $has_run will be TRUE if $bootstrap is FALSE.
$has_run = !$bootstrap;
}
return $has_run;
}
Just before the drupal_load('module', $module);
statement check for the specific url you are looking for and the admin-menu
module, if the condition holds skip the drupal_laod
statement. I mean
function module_load_all($bootstrap = FALSE) {
static $has_run = FALSE;
if (isset($bootstrap)) {
foreach (module_list(TRUE, $bootstrap) as $module) {
if(current_path != "SPECIFIC URL" || $module!="SPECIFIC MODULE")
drupal_load('module', $module);
}
// $has_run will be TRUE if $bootstrap is FALSE.
$has_run = !$bootstrap;
}
return $has_run;
}
The How do I prevent a module from being loaded? may also be helpful
Please note that this will require you to hack the core (modify a core source code) and is not recommended unless you have no other option.