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
๐ŸŒ
Real Python
realpython.com โ€บ python-optional-arguments
Using Python Optional Arguments When Defining Functions โ€“ Real Python
October 27, 2025 - You can assign default values to parameters so that arguments become optional ยท You should avoid mutable data types like lists or dictionaries as default values to prevent unexpected behavior ยท You can use *args to collect any number of positional ...
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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: >>> increment(10, 2) # n = 10, step = 2 12 >>> increment(10) # n = 10 11 ยท In the latter case, no argument is passed for the step parameter, and so the default value 1 is used instead, causing 10 + 1 == 11 to be returned.
๐ŸŒ
Leapcell
leapcell.io โ€บ blog โ€บ understanding-optional-arguments-in-python
Understanding Optional Arguments in Python | Leapcell
July 25, 2025 - Optional arguments are function parameters that are not required when the function is called. They are defined with default values in the function signature.
๐ŸŒ
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 - You achieve this by adding an equals after the parameter name followed by the default value ยท 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 ...
๐ŸŒ
Index.dev
index.dev โ€บ blog โ€บ python-functions-optional-arguments
5 Ways to Define a Function with Python Optional Arguments
November 4, 2024 - Optional arguments in Python are function parameters with default values. If not passed during the call, the default value is used.
Find elsewhere
๐ŸŒ
Runestone Academy
runestone.academy โ€บ ns โ€บ books โ€บ published โ€บ fopp โ€บ AdvancedFunctions โ€บ OptionalParameters.html
15.1. Introduction: Optional Parameters โ€” Foundations of Python Programming
When defining a function, you can specify a default value for a parameter. That parameter then becomes an optional parameter when the function is called. The way to specify a default value is with an assignment statement inside the parameter list.
๐ŸŒ
Index.dev
index.dev โ€บ blog โ€บ default-vs-optional-parameters-python
Default vs Optional Parameters in Python Functions: Key Differences
October 31, 2024 - Default parameters are those that have a default value if the caller does not specify one. Optional parameters: Parameters that accept a variable number of arguments via *args and **kwargs.
๐ŸŒ
iO Flood
ioflood.com โ€บ blog โ€บ python-optional-arguments
Python Optional Arguments | Guide (With Examples)
November 17, 2023 - In Python, you can make function arguments optional by assigning them a default value, such as def greet(name='World'):. This allows the function to be called with fewer arguments than it is defined to allow.
๐ŸŒ
Purple Engineer
purpletutor.com โ€บ home โ€บ understanding code โ€บ python optional parameters guide for better coding flexibility and readability
Python optional parameters explained with default values and examples
January 21, 2026 - Python optional parameters are function arguments assigned a default value, allowing you to call the function without providing a value for every parameter. This mechanism makes functions more flexible and your code cleaner, as it prevents errors ...
๐ŸŒ
Career Karma
careerkarma.com โ€บ blog โ€บ python โ€บ python optional arguments: a how-to guide
Python Optional Arguments: A How-To Guide | Career Karma
December 1, 2023 - Optional arguments are arguments that do not need a value. On Career Karma, learn how to accept optional arguments in a Python function.
๐ŸŒ
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 ?

๐ŸŒ
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 - 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. Keyword arguments, on the other hand, offer flexibility in the way you pass parameters to a function while calling it. Python ยท
๐ŸŒ
Prospero Coder
prosperocoder.com โ€บ home โ€บ functions in python โ€“ optional parameters
Functions in Python - Optional Parameters - Prospero Coder
May 5, 2022 - Optional parameters are also called default parameters. In the function definition optional parameters are assigned default values. When we call the function, we donโ€™t have to pass the arguments corresponding to the optional parameters, which ...
๐ŸŒ
Tech with Tim
techwithtim.net โ€บ tutorials โ€บ python-programming โ€บ intermediate-python-tutorials โ€บ optional-parameters
Python Tutorial - Optional Parameters
This python tutorial covers optional paramaters in python. Optional paramaters allow you to set a default value for a parameter if it is not given from the call.
๐ŸŒ
Index.dev
index.dev โ€บ blog โ€บ optional-arguments-python-functions
Mastering Optional Arguments in Python Functions: Best Practices and Tips
October 24, 2024 - Optional arguments are those that have a default value. If the caller does not specify a value for the argument, Python will use the default. The = symbol in the function signature denotes optional parameters.