This eliminates an import-time dependency on sage.misc.misc
.
(for #29865)
CC: @fchapoton @kiwifb @embray @tscrim
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: ce63cf5
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/31332