How to use a photodiode over a broad range of optical powers
If you stabilize the light by comparing the detector signal to a
voltage reference, the problem is that the three orders of magnitude range
means that your comparison may be to a 5V level at 40W, but will
be to a 0.00125 volt level to hit 10 mW.   The loop noise sensitivity
will be poor at the lowest power.
Easiest would be to have a gain-range determined by putting attenuators
into the optical path: a couple of neutral density filters,
or even calibrated holes in light stops,
can reduce the sampled light before it gets to the sensor.

Three ranges, with two 16x attenuators, will all map to
a loop error detection dynamic range of 5V to 0.3V, and 
even a mediocre error amplifier ought to give accurate results with
signals in that range.

Amplifiers with very low current errors can be employed with logarithmic gain setting, but the sensor itself may have low-light-level nonlinearities, so that is a less safe alternative.  Here see figure 48; Q2 polarity is drawn wrong
is a logarithmic current source; sum it with a light-dependent
current sink, and the resulting current is a  suitable loop error signal.