If your board is like my board and it starts a continuous tone the moment you power it up and after you stop the program then, good news! You don’t have to listen to it. Just choose a GPIO that is not outputting on power up. For me, I chose GPIO25, but I was able to find others. Just be sure to change the assignment in your code:
buzzer = machine.Pin(25, machine.Pin.OUT)