I always take this as Python's way of strongly discouraging deeply nested and overly long functions... ( I realise this might be Stockholm syndrome...)
Mypy fixes the second problem, at least.
Python at least has if ... elif ... else to deal with it.