Ok fair enough
The pin I am using is A5.
And the full code (which I was using before I uploaded the dummy code an hour ago) has thousands of lines, and everything works as expected. Even the switch on that pin, as long as the pulled-up voltage stays above 1V'ish. Strangely today it does not seem to go any lower - so everything works. But I know a few days ago it was around 1V and that was too low for the MCU to detect as "1".
While I am there I tried desoldering the pin from the switch - it made no difference. Then I soldered an external 10k pullup. Here is the result (and again, just when I started the voltage was about 3.1V, then it gets worse and worse after 10-15min). I tested the 3.3V rail and it's perfectly clean at 3.27V.