It's hard to generalize. I think the amount of perfection I demand in a solution is proportional to some combination of its importance and my interest in it. I have no trouble putting in place simple, hacky solutions with the intent of changing them later, and then actually changing them later.
My side projects, in particular, are where I allow myself to roam freely, and I often end up prioritizing unimportant (but interesting) work that is only tangential to the core idea. When I am only accountable to myself, then it becomes too easy to get unfocused.
Perhaps the original question should be rephrased as "how do I keep myself focused when working on side projects, since I'm only accountable to myself."
Depends on the purpose of your side projects.
Is the main aim to explore things that interest you or is it to "ship" something specific?
If it is the former then perhaps you shouldn't worry and just let the rabbit hole lead you where it may.
If it is the latter then perhaps it would help to produce some sort of roadmap. Ideally share this and get other people involved (either people who will work with you on it or who want to use the finished product) and they will perhaps keep you somewhat accountable.
If your side project involves multiple difficult problems then perhaps you need to accept that it is not going to be a 1 person job to get it done too the quality standard that you aspire too.
The answer is endorphins. The harder the problem that you solve, the bigger the fix you get. Hacky solution is not the solution, you know it, so you don't get much. If you realize and accept this as the cause, the solution to your problem (which I think is very common between the programmers) is obvious.
My side projects, in particular, are where I allow myself to roam freely, and I often end up prioritizing unimportant (but interesting) work that is only tangential to the core idea. When I am only accountable to myself, then it becomes too easy to get unfocused.
Perhaps the original question should be rephrased as "how do I keep myself focused when working on side projects, since I'm only accountable to myself."