"Analysis paralysis"
This is why deadlines are useful. The customer cares what was delivered, not how exquisitely sculpted my code was.
So the acme of skill is to nail the 80% of the challenge that is readily automated, eschew the yak shaving, and then maybe "polish the cannonball" if the problem comes 'round again.