I did a quick test yesterday evening using this few lines of code:
from machine import Pin
led=Pin(0,Pin.OUT)
switch=Pin(1,Pin.IN,Pin.PULL_UP)
while switch.value(): led.toggle()
GPIO0 was an output driving a LED. On GPIO1 I connected a momentary switch
to ground. On the output pin I got about 41 kHz until the switch was
pressed. With an endless loop:
while True: led.toggle()
I got 83 kHz.
I used Micropython v. 1.20; the Pico run at 125 MHz.
I also noticed some jitter. Normally one would not create a rectangle signal
this way but use a PWM channel for that task.