Thanks guys! I do need to try turning off the mains and see if it still happens. If it does, that'll really creep me out.

Here's some responses in no general order:

I don't think it's the toilet valve, but I'll check. The sound seems far more removed than that.

The water heater is two floors down from the bathroom, and the gas meter is pretty far away as well. I've also never heard this noise when standing right next to either of those things.

I suppose it could be plumbing or vent related, but the perfection of the repetition really makes me feel like it's electrical. I guess I'll have to wait to test that thought until the mains test.

The only place where this noise is audible is in the separate toilet room inside the master bath. One side of this closet-sized room is the shower, which has a complex valve in the wall that could be the source (but I know exactly where it is and I don't hear the sound louder where it is). Another side is a guest bedroom where my office is, but there's no sound in there. The third side is trickier because it's an attic-like area over the garage, which is actually somewhat separate from the rest of the attic. This makes me think it could be an attic fan, which would make sense because it could be something spinning up and down repeatedly.

I'll cut the mains and let you know what happens!
_________________________
Matt