The semantics of the
extlinks attribute annoyingly changed in Sphinx 4 which we addressed in #22690 (closed). However, in so doing we lost compatibility with older Sphinx versions, which are still in use on some distributions. Fix this.
However, the version check is a bit complicated due to #23818 (closed), which I also fix.