This is hopefully end of duplication. This batch did not cause clashes
in Sphinx but it was pointless nonetheless as we have auto-generated
anchors for all statements.
(cherry picked from commit 137e0f4e0e)
Adapted for v9_18 branch by doing cleanup also in
notes/notes-9.18.0.rst.