A program can easily waste time by calling a processor-intensive function multiple times.
For example, take a function which looks like this: it returns an integer if the input value can produce one, else None:
def intensive_f(value): # int -> Optional[int]
# complex, and time-consuming cod...