different_than_defaults = {}
if foobar:
    different_than_defaults['arg1'] = 'baaaz'
if barblah:
    different_than_defaults['arg4'] = 'bleck'
lots_of_defaults(**different_than_defaults)
Conditionally passing arbitrary number of default named arguments to a function