Disable module while running command
Here is one solution that I came up with after looking around in core's code. It seems to work as expected.

$module_list = module_list();
if (isset($module_list['token'])) {
    unset($module_list['token']);
}
// Reset the list to our new list of modules!
module_list(false, false, false, $module_list);
// Force to regenerate the stored list of hook implementations.
module_implements('', false, true);