Disable 3rdparty hook from custom module once
You could implement hook_module_implements_alter() to avoid a hook implemented by a module is invoked. The problem is that Drupal saves in cache the list of modules implementing a hook, but you can change the list of hooks implemented by modules back to the original one.

function mymodule_implements_alter(&amp;$implementations, $hook) {
  if ($your_condition &amp;&amp; ($hook == 'page_delivery_callback_alter')) {
    $old_implementations = &amp;drupal_static(__FUNCTION__, array());
    if (empty($old_implementations)) {
      $old_implementations = array_merge(array(), $implementations);
      unset($implementations['menu_trail_by_path']);
    }
  }
}

function mymodule_exit() {
  $old_implementations = &amp;drupal_static('mymodule_implements_alter', array());
  $implementations = &amp;drupal_static('module_implements');

  if (!empty($old_implementations)) {
    $implementations['page_deliver_callback_alter'] = $old_implementations;
  }
}


This code works only in the case hook_exit() is invoked, which is normally done in drupal_page_footer().

You should be sure mymodule_implements_alter() is executed after the implementations made from other modules, in order to preserve the changes done from other modules.