from functools import reduce


def extend(*dicts):
    """
    Returns a dictionary that combines all dictionaries passed as arguments
    without mutating any of them.
    """

    def fold(acc, curr):
        acc.update(curr)
        return acc

    return reduce(fold, dicts, {})