Improve Python coding in standard-parameter setting
Implementing the code tidying that couldn't be directly MR'd to Silke's branch. Note that it won't work in 21.6 until !31891 (merged) has been merged, but that's already a problem for Silke's MR that was already merged and hence not a blocker for accepting this update to it.