original post: scipy/scipy-stubs#153 (comment)
Annotating a function whose return type depends on an optional positional- or keyword-only parameter in Python
Overloads are roughly similar to pattern matching[^1], but from the perspective of the caller.
Consider this function for example