Yes it's bit of a trade-off, as usual in software. Hacking can be the fastest now, but having worked on 10000loc code which consisted mainly of such hacks and none of the feasible maintainability: your hack might cause a ton of lost time in the future.
Then again, the more experienced you get, the easier it will be to spot if a hack is the appropriate thing or not. Like if your software is already nicely established and loosely coupled you can apply hacks here and there without any negative effect on maintainability or functionality whatsoever.
Mainly C++ dev here, I do think for example LLVM is very well done, and Boost as well. But both are immense codebases and especially Boost is complicated to the point it's insane. It's a shame but I don't have good examples of relatively small projects to check out. Maybe that's worth an 'Ask HN' thread: I've definitely seen threads like 'Ask HN: what are good open source projects to check' but without the extra requirement they're small(ish). The concept of decoupling is usually not just in the details, but in the more higher level layers of the software, so to really grasp it you'd have to really spend some time on the whole project, not just read some files here and there. Which would obviously be easier with a small project.
I would point to both CLang and KDE as projects with very good modularity. I remember reading through the sources oc CLang a few years back and being impressed with it.