Pass variables to template using hook_block_view_alter()
I think a better option is to override PathProcessorFront::processOutbound():

 public function processOutbound($path, &amp;$options = array(), Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
    // The special path '&lt;front&gt;' links to the default front page.
    if ($path === '/&lt;front&gt;') {
      $path = '/';
    }
    return $path;


Overriding in this case means using a similar outbound pathprocessor with a higher priority and replace '/&lt;front&gt;' or a lower priority and replace '/'.

Edit:

Register the path processor as a service with the tag path_processor_outbound in mymodule.services.yml. This is the core service definition from the example before:

path_processor_front:
    class: Drupal\Core\PathProcessor\PathProcessorFront
    tags:
      - { name: path_processor_inbound, priority: 200 }
      - { name: path_processor_outbound, priority: 200 }
    arguments: ['@config.factory']