Like the other answers before mine, this technically still passes at least two arguments. This is because function overloading isn't really a thing in Python, (having multiple functions with the same name). If you want a variable number of parameters, you can use *args and/or **kwargs when calling the function, but your function would still technically have to be defined with multiple arguments:
def get_quest_guide_char(character, *args, **kwargs):
# ...
# or in your case
def get_quest_guide_char(character, *args):
# ...
Or more explicitly:
def get_quest_guide_char(character, marker_sector=None):
# ...
This will let you do both:
get_quest_guide_char("isabelle", marker_sector)
# and
get_quest_guide_char("isabelle")
Given that marker_sector depends on game.location, you could alternatively create another function that gives you the marker_sector, and simply pass that into your function regardless:
def get_marker_sector(location):
if (location == "school_english_class"):
marker_sector = "right_bottom"
else:
# ...
return marker_sector
marker_sector = get_marker_sector(game.location)
get_quest_guide_char("isabelle", marker_sector):
Alternatively, you could just pass in game.location to your get_quest_guide_char function:
def get_quest_guide_char(character, location):
if (location == "school_english_class"):
# ...
else:
# ...
get_quest_guide_char("isabelle", game.location)
Either way, I hope you're not intending on using marker_sector as a global variable inside any of your functions. Mutable global variables are asking for trouble.
get_quest_guide_chardo with themarker_sectorvariable ? You'll have the option of just making itNoneor just not passing all together with an actual if statement, but the first one will depend ifget_quest_guide_charwill handle amarker_sector=Noneproperly.