Commercial games are shipped on a quick schedule, so this doesn't always apply unless its a project that's maintained/cleaned up.
What I'd like to see (2D games): Permissively licensed, widget / sprite tooling, handling of rotation, blitter, canvas resizing, scaling.
Anecdote: I made a request for a Zelda clone to make their code available via a commercial-friendly license here: https://github.com/solarus-games/solarus/issues/826
Look at this, well-maintained C++ bits and pieces wrapping around SDL2, that could easily apply to more than just this game:
https://github.com/solarus-games/solarus/tree/dev/src/core
https://github.com/solarus-games/solarus/tree/dev/src/graphi...
If something is open sourced, I highly prefer it if generic parts are available for everyone to use on their own projects. Keep the creative work proprietary / GPL / etc.
One reason we do open source is we don't want to perpetually reinvent the wheel. Projects last longer when they have users. And in this case of a library, your stuff is directly used by developers, further increasing the likelihood of reciprocal contributions / sharing the burden of maintenance.