You handle it by teaching them how to write good code.
And if they refuse to learn, then they get bad performance reviews and get let go.
I've had junior devs come in with all sorts of bad habits, from only using single-letter variable names and zero commenting, to thinking global variables should be used for everything, to writing object-oriented monstrosities with seven layers of unnecessary abstractions instead of a simple function.
Bad LLM-generated code? It's just one more category of bad code, and you treat it the same as all the rest. Explain why it's wrong and how to redo it.
Or if you want to fix it at scale, identify the common bad patterns and make avoiding them part of your company's onboarding/orientation/first-week-training for new devs.
Because if it's bad, at least it's simple. Meaning simple to review, quickly correct and move on.
And if you know a solution should be 50 lines and they've given you 500, it's not like you have to read it all -- you can quickly figure out what approach they're using and discuss the approach they should be using instead.
We've even been getting "prompt engineering" meeting invites of 3+ hours to get an introduction into their usage. 100-150 participants each time I joined
It's amazing how much they're valuing it. from my experience it's usually a negative productivity multiplier (x0.7 vs x1 without either)
If they're not doing their job, then why do they still have one?
(Practical nuclear fusion has 10 years away in 1954, and it's still 10 years away now. I suspect in practice LLMs are in a similar space; everyone seems to be fixated on the near, supposedly inevitable, future where they are actually useful.)