Override a theme template variable with a module
Taking the lead from @Alfred Armstrong above and my colleague, this ended up working!

In mytheme.theme

function mytheme_preprocess_page(&amp;$variables) {
  if(!isset($variables['var1'])) {
    $variables['var1'] = 'defaultvalue1';
  }
}


In mymodule.module

function mymodule_preprocess_page(&amp;$variables) {
  $variables['var1'] = 'myvalue1';
}