"where possible" is a keyword here and easy to argue about. For example:
* my logic requires a database
* my logic should be isolated for compliance reasons
* my logic accesses a service which is not available for everyone
* my logic should be processed async and needs to store state, how do I make sure library owners have that environment
* customers embedding my library are not upgrading it frequently, which leaves us to support 15 years of libraries
* ...
Imagine a scenario, your service is a low traffic, but service which embeds you as a library is a high traffic with many instances and always opens DB connection.
Why should you optimize your Database for high traffic use case, when your use case is really a low traffic?
And then repeat this for 10 other libraries and library owners. Everyone is optimizing for nothing.
make it even more difficult, 100 different types of services with different traffic patterns are embedding your library with different behaviours when it comes to managing DB connection state
Scenario: your service is accessing a service which exposes PII data and you only process them.
Service which embeds your service enabled audit logs of network requests and made it visible to everyone in the company. You have created a risk unintentionally