The C SDK example that shows how to read the button (https://github.com/raspberrypi/pico-exa ... n/button.c) explains that the trick to doing this is as follows:
Are those restrictions going to make it impossible to add this to Micropython?//Picoboard has a button attached to the flash CS pin, which the bootrom
// checks, and jumps straight to the USB bootcode if the button is pressed
// (pulling flash CS low). We can check this pin in by jumping to some code in
// SRAM (so that the XIP interface is not required), floating the flash CS
// pin, and observing whether it is pulled low.
//
// This doesn't work if others are trying to access flash at the same time,
// e.g. XIP streamer, or the other core.