Just use the *args parameter, which allows you to pass as many arguments as you want after your a,b,c. You would have to add some logic to map args->c,d,e,f but its a "way" of overloading.

def myfunc(a,b, *args, **kwargs):
   for ar in args:
      print ar
myfunc(a,b,c,d,e,f)

And it will print values of c,d,e,f


Similarly you could use the kwargs argument and then you could name your parameters.

def myfunc(a,b, *args, **kwargs):
      c = kwargs.get('c', None)
      d = kwargs.get('d', None)
      #etc
myfunc(a,b, c='nick', d='dog', ...)

And then kwargs would have a dictionary of all the parameters that are key valued after a,b

Answer from Nix on Stack Overflow
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ optional-arguments
Python Optional Argument: Syntax, Usage, and Examples
An optional argument in Python is a function parameter that has a default value, so you can call the function with or without passing that value.
Discussions

Should `None` defaults for optional arguments be discouraged? - Core Development - Discussions on Python.org
I recently merged a PR authored by Sergey Kirpichev that fixes inspect.signature (which previously failed with a ValueError) for math.log and cmath.log. A side-effect of that change is that math.log and cmath.log now accept the Python value None for the base argument. More on discuss.python.org
๐ŸŒ discuss.python.org
9
February 5, 2023
Adding optional arguments to a function
Type hints are ignored by the interpreter. You still need to provide a default value for the argument if one isn't provided in the function call. The appropriate default value to use with the Optional type hint is None, so: def function( data1: list, data2: list, opt1: Optional[list] = None, new: Optional[dict] = None, ) More on reddit.com
๐ŸŒ r/learnpython
2
1
September 8, 2021
Type hinting with for callables with optional arguments
Currently on a train but in short you want to take a look at protocols. They are available since Python 3.8+. PEP: https://peps.python.org/pep-0544/ More on reddit.com
๐ŸŒ r/learnpython
9
2
May 30, 2024
Be careful with default args in Python
This is basically the first Python gotcha More on reddit.com
๐ŸŒ r/programminghorror
327
4209
April 2, 2024
๐ŸŒ
Real Python
realpython.com โ€บ python-optional-arguments
Using Python Optional Arguments When Defining Functions โ€“ Real Python
October 27, 2025 - You define Python functions with optional arguments to make them flexible and reusable. By assigning default values, using *args for variable arguments, or **kwargs for keyword arguments, you let your functions handle different inputs without ...
๐ŸŒ
Python.org
discuss.python.org โ€บ core development
Should `None` defaults for optional arguments be discouraged? - Core Development - Discussions on Python.org
February 5, 2023 - I recently merged a PR authored by Sergey Kirpichev that fixes inspect.signature (which previously failed with a ValueError) for math.log and cmath.log. A side-effect of that change is that math.log and cmath.log now accept the Python value None for the base argument.
๐ŸŒ
The Python Coding Book
thepythoncodingbook.com โ€บ home โ€บ blog โ€บ optional arguments with default values in python functions [intermediate python functions series #3]
Optional Arguments with Default Values in Python Functions
January 18, 2023 - When you call the function, the corresponding argument is optional. If the argument is not present in the function call, the default value is used ยท Next Article: Argh! What are args and kwargs in Python?
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ adding optional arguments to a function
r/learnpython on Reddit: Adding optional arguments to a function
September 8, 2021 -

I am working on a project where I'm supposed to add new features to an existing codebase. As part of this, I need to add an optional argument to one of the functions but just adding the optional argument is causing some of my unit tests to fail.

The function looks like the following initially:

def function(data1: list,     
            data2: list,
             opt1: Optional[list],
 ) 

After adding another optional argument it looks like this:

def function(
    data1: list,
    data2: list,
    opt1: Optional[list],
    new: Optional[dict],
)

The only change I'm making in the codebase is adding this optional argument and it is causing some of my unit tests to fail. I was wondering if someone knows what might be the reason ?

Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-pass-optional-parameters-to-a-function-in-python
How to Pass Optional Parameters to a Function in Python - GeeksforGeeks
July 23, 2025 - In Python, functions can have optional parameters by assigning default values to some arguments. This allows users to call the function with or without those parameters, making the function more flexible.
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 781167 โ€บ how-do-i-use-optional-arguments-in-python
How do I use optional arguments in python? | Sololearn: Learn to code for FREE!
I'm making a function for a homework that use 3 arguments but only 2 are strictly needed, is there a way to make the function work if the user forget to give the third argument?... sorry for my english by the way ... I want to make a small chatbot that asks you questions and recommends an option in python.
๐ŸŒ
University of Toronto
teach.cs.toronto.edu โ€บ ~csc110y โ€บ fall โ€บ notes โ€บ 12-interlude-nifty-python-features โ€บ 03-functions-with-optional-parameters.html
12.3 Functions with Optional Parameters
Suppose we want to define a function that takes a number n and by default returns n + 1, but allows the caller to specify an optional step amount to increase by. def increment(n: int, step: int = 1) -> int: """Return n incremented by step. If the step argument is omitted, increment by 1 instead. """ return n + step ยท Letโ€™s experiment with this function in the Python console:
๐ŸŒ
Django
docs.djangoproject.com โ€บ en โ€บ 6.0 โ€บ ref โ€บ models โ€บ fields
Model field reference | Django documentation | Django
The optional save argument controls whether or not the model instance is saved after the file associated with this field has been altered. Defaults to True. Note that the content argument should be an instance of django.core.files.File, not Pythonโ€™s built-in file object.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ user โ€บ absolute_beginners.html
NumPy: the absolute basics for beginners โ€” NumPy v2.4 Manual
With two or more arguments, return the largest argument. Type: builtin_function_or_method ยท You can even use this notation for object methods and objects themselves. ... Then you can obtain a lot of useful information (first details about a itself, followed by the docstring of ndarray of which a is an instance): In [1]: a? Type: ndarray String form: [1 2 3 4 5 6] Length: 6 File: ~/anaconda3/lib/python3.9/site-packages/numpy/__init__.py Docstring: <no docstring> Class docstring: ndarray(shape, dtype=float, buffer=None, offset=0, strides=None, order=None) An array object represents a multidimensional, homogeneous array of fixed-size items.
๐ŸŒ
X
x.com โ€บ realpython โ€บ status โ€บ 2046687934464594413
๐Ÿ๐Ÿ“ฐ Using Python Optional Arguments When Defining ...
Using Python Optional Arguments When Defining Functions โ€” https://realpython.com/python-optional-arguments/โ€ฆ #python
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-specify-optional-function-parameters-419771
How to specify optional function parameters | LabEx
This tutorial explores various ... with minimal complexity. Optional parameters are function arguments that are not required to be passed when calling a function....
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_arguments.asp
Python Function Arguments
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... Information can be passed into functions as arguments.
๐ŸŒ
GitHub
github.com โ€บ casey โ€บ just
GitHub - casey/just: ๐Ÿค– Just a command runner
4 days ago - ๐Ÿค– Just a command runner. Contribute to casey/just development by creating an account on GitHub.
Starred by 34.4K users
Forked by 803 users
Languages ย  Rust 98.2% | Shell 1.1% | Just 0.4% | Nix 0.1% | CSS 0.1% | HTML 0.1%
๐ŸŒ
Built In
builtin.com โ€บ software-engineering-perspectives โ€บ arguments-in-python
5 Types of Python Function Arguments | Built In
An overview on the different function arguments in Python. | Video: Telusko ยท Default arguments are values that are provided while defining functions. The assignment operator = is used to assign a default value to the argument. Default arguments become optional during the function calls.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_args_kwargs.asp
Python *args and **kwargs
Arbitrary Arguments are often shortened to *args in Python documentation.
๐ŸŒ
Medium
medium.com โ€บ @khanfarazahmed7 โ€บ difference-between-required-optional-positional-and-keyword-arguments-in-python-functions-1fa9cd6a46c4
Difference between Required, Optional, Positional and Keyword arguments in Python functions | by Faraz Khan | Medium
November 15, 2023 - While arg=value for optional and ... purposes. Optional arguments make function calls easier by letting you define a function that can be called with fewer arguments than it is defined to allow....
๐ŸŒ
Starship
starship.rs โ€บ config
Starship: Cross-Shell Prompt
April 26, 2026 - The current directory contains a .python-version file ... The current directory contains a file with the .py extension. The current directory contains a file with the .ipynb extension. ... a list of lists of strings, representing commands with optional arguments (e.g.