Repurposing this ticket to solve this whole category of problems, not just this one particular one.
Work-in-progress PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/140
Specifically gonna incorporate material from JENKINS-42777 into tests here to make as sure as humanly possible that we don't cause regressions with this.
Bulk closing resolved issues.