"Shrink" library dependencies

I see two solutions here:

If it is just about the storage on your harddrive you can use a global version of the library and include it via symlink in the platformio.ini to your project. See Are libraries duplicated? - #2 by sivar2311

If this should also apply to other users of your project I would recommend to create a fork of the library. Then remove the unwanted stuff and use the forked version of the library in your project.