I woke up this morning and looked back at the documentation.
A part I mis-read was this:
We recommend to use src folder for your C/C++ source files and include folder for your headers. You can also have nested sub-folders in src or include.
I had my headers stored in the lib folder :facepalm:
I tried to search around in the platformio docs for the ...
Serial.<anyKindOfOutput> all goes to the terminal. So without knowing more about your application, I can only guess, but you could:
Comment out the Serial.write()s.
Surround the Serial.write()s with #ifdef SUPPRESS and #endif.
Put the Serial.write()s in an if( ) block whose control expression will only be true when you need the Serial.write()s to be ...