From what I can tell, the speed sensor (on my compressor anyway) does not require discharging the system. It appears to be some sort of electromagnetic sensor that just slips in the axis of the compressor, i.e. no contact with the refrigerant.
That's in theory, anyway.
However, in my car, it is virtually impossible to get at the sensor and the wiring, so to change the sensor requires removing the compressor. Which of course requires discharging the system.
If your car doesn't require removing the compressor, you should be ok.
1999 E320 Wagon