Speed up finding function type variables (#16562)
Merge two visitors into a single visitor that is a bit more optimized
than the old visitors.
This speeds ups tests, in particular -- `mypy/test/testcheck.py` is
about 4% faster and `mypy/test/testpythoneval.py` is about 3% faster.
Also self-check is about 1% faster, both interpreted and compiled.
This adds more code, but the new code is largely boilerplate, so the
difficulty of maintenance seems roughly the same.