Not really sure the best way to go about this yet. Using "https://github.com/me-no-dev/RasPiArduino" could possibly be useful. Cross-platform compatibility should be a priority for ESP32 projects running on Pi. Compatibility for Pi programs to work on ESP32 is not a priority as the Pi should support much more versatility which might not be able to be ported to Arduino ESP C++.