$is_front is not available in all templates
You almost answered the question yourself, you can add the variable to all templates with this code:

function theme_preprocess(&amp;$variables, $hook) {
  try {
    $variables['is_front'] = \Drupal::service('path.matcher')-&gt;isFrontPage();
  }
  catch (Exception $e) {
    $variables['is_front'] = FALSE;
  }
  // Ensure the cache varies correctly (new in Drupal 8.3).
  $variables['#cache']['contexts'][] = 'url.path.is_front';
}


For performance reason you can make a condition on $hook to only add the variable to the templates you need, and to avoid that the code is run twice for page.

Edit:

New in Drupal 8.3: Cache context for determining the Front Page