I wrote a simple gpioctl wrapper with Python in NetBSD RPi configurations. This wrapper cannot change the pin mode. Please configure manually in /etc/gpio.conf
the wrapper:
https://brew.bsd.cafe/maulanahirzan/Python-Useful-Scripts/src/branch/main/NetBSD-GPIO%20Example
config in gpio.conf:
https://github.com/catskillmarina/netbsd-gpio-doc