gh-38619: Re-add py3.9 support to sage_autodoc.py
This PR corrects the fact the sage_autodoc.py changes needed for sphinx
8 dropped python 3.9 support. This is a consequence of the fact that
sphinx 8 has dropped python 3.9.
Since we still want to support python 3.9, some support has to be re-
introduced.
See https://github.com/sagemath/sage/pull/38549#issuecomment-2327790930
and after.
### :memo: Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.
URL: https://github.com/sagemath/sage/pull/38619
Reported by: François Bissey
Reviewer(s): Kwankyu Lee