[Python-ideas] An alternative to using a clamp / clip / trim function