Replace Union annotations with TypeVar
Had a revelation after https://github.com/python/mypy/issues/6847#issuecomment-493715355 and I think we've been using Union too liberally in places where a TypeVar may make more sense (especially in pandas._typing) so would be good to go back and swap those out.

@gwrome @vaibhavhrt 