title: Best practice default function parameters python
body: <p>I would like to know what the best practice is regarding default values for functions. </p>
  
  <p>Let's say I have a function:</p>
  
  <pre><code>def my_function(x, **kwargs):
      kwargs_default = {'boolean_offset': False}
      kwargs_default.update(kwargs)
  
      if kwargs_default['boolean_offset']:
          x += 100
      return x
  </code></pre>
  
  <p>It is just a quick example and does not have any other meaning.</p>
  
  <p><code>my_function(2)</code> will return <code>2</code>. <code>my_function(2, boolean_offset=True)</code> will return <code>102</code>. </p>
  
  <p>The point is that I have a variable called <code>boolean_offset</code> that is turned off by default, but may be turned on by the user. </p>
  
  <p>In my real problem I have a function with many input variables. Often not all of these input variables are used and in most cases users want to use the default settings. To make the code more readable I would like to use <code>*args</code> and <code>**kwargs</code>. Further I would like the potentially used variables to have default values, which can be overwritten by the user.</p>
  
  <p>Is the code in my example the best way to do this? </p>