My Lumix GX1 has an on/off
SHADING COMP. setting in the Rec menu, and it's set to off. What is this setting and what effect would it have when turned on? When do I want it?
Shading Compensation is normally called Vignetting Correction. It simply corrects for a known falloff in light intensity towards the edges of the frame.
The cameras has to know the lens attached; otherwise it won't work, which is why you sometimes need a firmware upgrade when newer lenses become available.
Vignetting is one of the easiest and least destructive things to correct in software but it does have some adverse effect. Notably the brightening of the edges causes increased noise. For a lens with little fall-off, this is mostly unnoticeable, but some lenses have 2 EV or even more of vignetting. With 2 EV that would require multiplying pixels at the edges by 4, which is like shooting at 2 stops of ISO higher!
Wisely, Panasonic is giving you the option of lowering image quality or not by having the default at "off". Not all brands do that. Note that if you shoot RAW, this setting has no effect.