This is to support modularization.
Also, in extension of #32566, we switch another method to use sage.rings.abc
for isinstance
testing.
(cherry-picked from #32432)
Depends on #32566
Depends on #32606
Depends on #32612
CC: @kliem @tscrim @roed314
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: 6d4ee6e
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/32635