gh-36374: refresh the cython file real_roots (pep8, range, etc)
just refreshing a little bit the code in the modified file
- using range at some place (partial)
- fix all cython-lint warnings
### :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/36374
Reported by: Frédéric Chapoton
Reviewer(s): David Coudert, Frédéric Chapoton