I think it depends a bit on how you are planning to use these “modules” and if you are expecting other users to use them as well or if it’s mostly for your own use cases only.
Writing an extension would allow other users to easily use your modules by just rebuilding/installing them, but would also need some maintenance effort on your side.