Dynamic value in Twig or preprocess based on config and getHost()
In case you wondered, I resolved this by adding my methods to a service class, as @Hudri suggested in comments.
I can call those methods in a Form or other OO class by dependency injection of the Drupal\clientname_cta_base\Cta\Base service class:
    // Active URL configuration (read-only).
    $form['clientname_cta_base_computed_base_url'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; $this-&gt;t('Computed base URL (Preview)'),
      '#default_value' =&gt; $this-&gt;ctaBase-&gt;getBaseUrl(),
      '#description' =&gt; $this-&gt;t('Read-only value based on config and environment. Save changes to update.'),
      '#attributes' =&gt; ['disabled' =&gt; 'disabled'],
    ];
    $form['clientname_cta_base_computed_cta_url'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; $this-&gt;t('Computed CTA URL (Preview)'),
      '#default_value' =&gt; $this-&gt;ctaBase-&gt;getCtaUrl(),
      '#description' =&gt; $this-&gt;t('Read-only value based on config and environment. Save changes to update.'),
      '#attributes' =&gt; ['disabled' =&gt; 'disabled'],
    ];

The example above does not include all the dependency injection setup in the Form class, or the service class setup, services YAML config, and other steps that are well documented elsewhere.
In theme preprocess, dependency injection is not available, so I get the computed values via \Drupal::service('cta.base') like so:
/**
 * Implements template_preprocess_page().
 */
function clientname_preprocess_page(&amp;$variables) {
  $service = \Drupal::service('cta.base');
  $config = \Drupal::config('clientname_cta_base.settings');
  $variables['computed_base_url'] = $service-&gt;getBaseUrl();
  $variables['computed_cta_url'] = $service-&gt;getCtaUrl();
  $variables['default_link_text'] = $config-&gt;get('default_link_text');
}

Note that for configuration values that are not dynamically generated, I can just access them directly in theme preprocess via \Drupal::config('clientname_cta_base.settings').