refactor: remove the class coercion to ContinuousMonoidHom (#46439) Part of #31365
ContinuousMonoidHom