title: Calling function with optional arguments with PyObject_CallMethod
body: <p>Using Python C API, how can I call a function with optional arguments?</p>
  
  <p>For example, assuming there is a Python module <code>add_module.py</code> with a function <code>add</code> that goes like:</p>
  
  <pre><code>def add(a=0, b=0):
    return a + b
  </code></pre>
  
  <p><code>add(1, 2)</code> would correspond to </p>
  
  <pre><code>PyObject *add_module = PyImport_ImportModule("add_module");
  PyObject *result = PyObject_CallMethod(add_module, "add", "ii", 1, 2);
  </code></pre>
  
  <p>How would I call something like <code>add(b=5)</code> using the Python API?</p>
  
  <p>Thanks!</p>