[WIP] fix --check-untyped-defs for MyPy
**tl;dr No need for review!**

no intention of merging this so using patterns that probably won't be accepted.

PR is for visibility and reference only.

using http://blog.zulip.org/2016/10/13/static-types-in-python-oh-mypy/ as a suitable template for a project plan. resolution of #27568 would come before too much work on adding type hints in general.

There is quite a bit of work involved to enable check-untyped-defs globally so need to keep the phases described in "Fully annotating a large codebase" section as out-of-scope for now.

I do not expect to complete this in the near term, so am using Python 3.6 type annotations for variables (better formatting with black and no need to initialize variables to None) and mypy 0.720 for checking (less false positives)

One of the advantages of enabling check-untyped-defs globally, is the additional checking of PRs.

However, for as long as I can keep this branch in sync with master, this additional checking is effectively being performed.

The goal is to cover as much ground in the shortest possible time. The piecemeal approach of submitting separate PRs was, IMO, not allowing us to see the wood from the trees. The extent of the work involved (and changes required) won't be known till the majority of modules have been covered.

So far, nothing major has surfaced. If latent bugs are discovered could always break bits off and submit for review along the way.


