gh-36528: some cleanup in quadratic forms
mostly a pep8 cleanup in quadratic_forms, also some code details
hand-made
### :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/36528
Reported by: Frédéric Chapoton
Reviewer(s): David Coudert