This comment reminds me of something of a thought-experiment-come-hacky-side-project that I can’t seem to find.
The premise was, what if you could never edit a function? Instead, you had to delete it and recreate it entirely whenever changes were needed.
The incentives are twofold - keep functions small, so you don’t lose too much investment if you have to delete code, and think before you start writing, else you waste time.
As I remember, this project came with an AST manipulator that would helpfully delete your function if it’s unit tests failed.