`Pin.toggle()` method works (at least for RP2040 platform) but it is not documented here: https://docs.micropython.org/en/latest/library/machine.Pin.html#methods