gh-37683: some shortcuts using bool
fixes suggested by `ruff --select=SIM210`
namely use `bool` for concision
### :memo: Checklist
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
URL: https://github.com/sagemath/sage/pull/37683
Reported by: Frédéric Chapoton
Reviewer(s): Matthias Köppe, Travis Scrimshaw