How to use overloaded signatures in Python?

Sometimes a function takes multiple arguments of different types, and the return type depends on specific combinations of inputs. It’s often easy to understand by reading code, but how do you tell the type checker that this is the case? This is where the @overload decorator from the typing module comes handy.