cmake: head fix

Closes #34517.

Also fixes up the Python element to match Tim’s new guidelines.