Better handling of generic functions in partial plugin (#17925)
Fixes https://github.com/python/mypy/issues/17411
The fix is that we remove type variables that can never be inferred from
the initial `check_call()` call. Actual diff is tiny, I just moved a
bunch of code, since I need formal to actual mapping sooner now.