the PIO as well Espressif toolchain will do the exact same thing, that is read the file, inject it into the binary at some point and make it visible as a symbol name by the namescheme _binary_<path>_start and _binary_<path>_end. The binary gets then uploaded to the flash.
This API on the other hand (read this) allocates a section in flash for the creation of a non-volatile data storage system.
These are two ways to store data. The NVS API should also be available in PlatformIO if it’s included in the ESP-IDF version that PIO distributes (see Releases · platformio/platform-espressif32 · GitHub).