BLD: fix odd usage of cython imports, xref (GH8602)