One object level suggestion is you shouldn't be doing string formatting manipulation to construct valid YAML objects as part of your ops pipeline; instead, do it all with actual data structures and then just render the result. Yes, I know that Helm directly encourages text templating — it's bad and wrong.
Beyond that, this a too-long essay about a deeply poisonous and discouraging worldview. I regret having read it. At least it wasn't written by AI!
And, as with so many blatantly bad and wrong things in modern development, someone will show up just to scream at you confusedly if you as much as think of solving it somehow better (e.g. how you describe) because they have mastered the officially endorsed badwrong way (and even that with great difficulty) thus you'd be stealing their cat turds
Beyond that, this a too-long essay about a deeply poisonous and discouraging worldview. I regret having read it. At least it wasn't written by AI!