Is there a way to partially rebuild the router or invalidate a route cache?
Instead of \Drupal::service('router.builder')-&gt;rebuild() you can invalidate route matches:
Cache::invalidateTags(['route_match']);

You don't need to rebuild the router table, because the static routes don't change. What you need to clear are route matches, which are calculated on the processed path and then stored for the unprocessed path. And this is the relation which changes in your case.
The router builder invalidates the route matches because after a route rebuild there might be routes missing which are still in route match collections.
To be more selective you can add a second cache tag for the frontpage in RouteProvider::getRouteCollectionForRequest and then only invalidate this tag.
Of course you also need to invalidate entries of the front page stored in page caches, but the front page has probably already a specific cache tag you can target.