def _fill_defaults(context, builder, sig, args, defaults):
    ty = sig.return_type
    llty = context.get_data_type(ty)
    args = tuple(args) + tuple(ir.Constant(llty, d) for d in defaults[len(args):])
    sig = signature(*(ty,) * (len(args) + 1))
    return sig, args
Assuming a homogenous signature (same type for result and all arguments),
dataset/ETHPy150Open numba/numba/numba/targets/randomimpl.py/_fill_defaults