pythonize cython code
Use python-style type annotations instead of cython-style in a few places.

Use python-style isinstance checks in cases where cython will automatically optimize them into C calls.

Part of the hope is that we can get the code close enough to valid python that we can trick flake8 into working on it.