Change Link URL in preprocess function
Drupal's Core Url has a static fromUri() method (see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Url.php/function/Url%3A%3AfromUri/8.2.x)
With that in mind you should be able to swap out the ['#url'] with a new one thusly:
...['#url'] = \Drupal\Core\Url::fromUri('externalURL');