gh-37355: less usage of method .is_commutative
changing a few calls of `R.is_commutative()` for rings, in favour of the
syntax `R in CommutativeRings()`
### :memo: Checklist
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
URL: https://github.com/sagemath/sage/pull/37355
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw