remove various dead version checks (closes #22349)

Patch from Thomas Kluyver.