That’s a big reason that I spend so much time developing modules.
Most of my published code consists of SPM modules.
I test the bejeezus out of each one, and some, I never use, but it’s worth it, to me, to have their functionality available, when I need it. It’s not particularly practical or efficient. It’s very effective, though.
But WFM. YMMV.
I don’t get paid for the work I do, and seldom have schedule pressure. This allows me to deliver really high-Quality results, fairly quickly. Also, since I’m usually working alone, it allows me to ship rather significant-scope deliverables.