title: Override a keyword argument in Python
body: <p>Python version: 3.10.0</p>
  <p>I have multiple functions using same arguments, mostly with same values also, so I decided to use keyword arguments instead to reduce the amount of parameters provided to the functions.</p>
  <p>However, now I ran into this issue: What if I would like to override some of the keyword arguments with custom values, without altering the 'global defaults'?</p>
  <p>Using a simplified example:</p>
  <pre><code>def func(arg1, arg2, **kwargs):
      print(f&quot;Received: {arg1} {arg2} {kwargs}&quot;)
      print(f&quot;Special: {kwargs.get('special')}&quot;)
  
  
  def func2(arg1, arg2, **kwargs):
      print(f&quot;Received: {arg1} {arg2} {kwargs}&quot;)
      print(f&quot;Special: {kwargs.get('special')}&quot;)
  
  
  common = {
      'param1': 10,
      'param2': True,
      'special': &quot;SPECIAL_DEFAULT&quot;
  }
  
  if __name__ == '__main__':
      func(&quot;test&quot;, &quot;some-value&quot;, **common)
      func2(99, None, **common)
  
      # For example, for this call, I want to override one of the common arguments with a different value
      # Without altering var common that is used globally
      # However, it throws TypeError because 'special' is defined in multiple places now
      func(&quot;test&quot;, &quot;some-another-value&quot;, special=&quot;SOMETHING_ELSE&quot;, **common)
  </code></pre>
  <p>I have stored all common keyword arguments in a dict that is provided into all functions using the common arguments.</p>
  <p>However, when I try to override some of the keyword arguments Im getting this error:</p>
  <pre><code>Traceback (most recent call last):
    line 24, in &lt;module&gt;
      func(&quot;test&quot;, &quot;some-another-value&quot;, special=&quot;SOMETHING_ELSE&quot;, **common)
  TypeError: __main__.func() got multiple values for keyword argument 'special'
  </code></pre>
  <p>Meaning that Python cant decide which of the provided values it would use.</p>
  <p>What would be the cleanest (most elegant) way to overcome this issue?</p>