A surprisingly competent AC power-line voltage / current / energy / power meter fits neatly into a mud ring atop a 4×4 inch square electrical box:

The inside view shows the wiring, such as it is:

The square black block is the split-core current transformer around the hot line wire, which sticks up just enough in any orientation to require an extension ring, thus a second trip to the Big Box store.
The mud ring has two tabs with threaded screw holes for the device (switch / GFCI / whatever): grab those with a Vise-Grip, flex until they break off, then file down the stub.
Generous globs of hot-melt glue secure the meter in the mud ring. I added a strip of duct tape under the connections in the hope it might avert disaster should either of the AC wires come loose, but my real hope is in the safety ground to the metal box.
The line cord comes from the Box o’ IEC cords, minus its IEC connector, plus the bright yellow USA-ian connector.
Yes, the three metal box pieces and the Leviton connector cost far more than the meter.
Not to code, but good enough for my purposes.
Spam comments get trashed, so don’t bother. Comment moderation may cause a delay.