Illumination is performed at low temperature on dopant-free two-dimensional electron gases (2DEGs) of varying depths, under unbiased (gates grounded) and biased (gates at a positive or negative voltage) conditions. Unbiased illuminations in 2DEGs located more than 70 nm away from the surface result in a gain in mobility at a given electron density, primarily driven by the reduction of background impurities. In 2DEGs closer to the surface, unbiased illuminations result in a mobility loss, driven by an increase in surface charge density. Biased illuminations performed with positive applied gate voltages result in a mobility gain, whereas those performed with negative applied voltages result in a mobility loss. The magnitude of the mobility gain (loss) weakens with 2DEG depth, and is likely driven by a reduction (increase) in surface charge density. Remarkably, this mobility gain/loss is fully reversible by performing another biased illumination with the appropriate gate voltage, provided both n-type and p-type Ohmic contacts are present. Experimental results are modeled with Boltzmann transport theory, and possible mechanisms are discussed.