Compile and save file for future upload?

The compiled firmware is in .pio\build\<environment name>\firmware.bin, that can be used for flashing.

PlatformIO also supports a upload-without-build, so you may be able to build once, delete the source files, but keep the build output in .pio, and run that command.