[Python-checkins] bpo-40280: Move hard-coded feature checks to configure (GH-29789)