There was another discussion where somebody was turning off auto-exposure and using manual exposure. You may be able to adapt their code to achieve your goal.
For example, you could first disable automatic exposure with sensor.set_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE, false);
Then get the current exposure (the last value set before auto-exposure was disabled):
And make a custom-named manual exposure variable (such as the new_exposure used in that linked-to case) equal to the current exposure value above. Something like this structure:
new_exposure = sensor.get_option(RS2_OPTION_EXPOSURE)
And set the exposure manually using that custom variable: