Control GPIO Voltage

Perhaps this binding can help. It supports the use of hardware generated pwm signals based on the internal 19.2 MHz crystal oscillator (54 MHz for Pi4B) which should be more than enough to control things like LEDs

I use it to drive a PWM fan at 25kHz, together with a CMOS to convert from 3.3V to 5V logic.