CLN: Assorted cleanups
By far the largest component of the diff is removing `from numpy import nan` imports and enabling the corresponding code-check.

Other than that there are a handful of cleanups, typings, docstring, and error message improvements collected from orphan branches locally.