platformIO is not using the M5Stack specific Arduino core at all. It uses the Espressif standard core (https://github.com/espressif/arduino-esp32/). Hence that version may be missing some specific configurations or extra functions.
In the case of the M5Stamp S3, when looking at the schematics, it appears that there is no USB-to-UART adapter chip on the board, the ESP32S3 is connected directly to the USB-C plug. As thus, Serial should be using the native USB-CDC capabilities of the ESP32S3 chip.
Both the Arduino IDE (Espressif core) and PlatformIO have that turned off though.
Thus, you should try this platformio.ini that activates it again:
[env:m5stack-stamps3]
platform = espressif32
board = m5stack-stamps3
framework = arduino
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
monitor_speed = 115200