Is it possible to pass configuration values as arguments to services?
In your services file add the following service:

# The bar configuration for the foo module
config.foo.bar.immutable:
  class: \Drupal\Core\Config\ImmutableConfig
  factory: config.factory:get
  arguments: ['bar']
config.foo.bar.mutable:
  class: \Drupal\Core\Config\Config
  factory: config.factory:getEditable
  arguments: ['bar']


In your service create method add either config.foo.bar.immutable or config.foo.bar.mutable service as an argument.