Update: the argument to setValue
here needs to be an int not a boolean in order to be restored correctly:
qt.QSettings().setValue('DataProbe/sliceViewAnnotations.scalarBarEnabled', 1)
import DataProbeLib
DataProbeLib.SliceAnnotations().updateSliceViewFromGUI()