Flake8 cleanup star imports (dev_5_0)

Removing all star imports, which uncovered a few indirect or missing imports

--rebased-from #2218