I don’t know if this is new for Blender 4.1, but you can achieve this by pressing CTRL while painting, whether in Add or Subtract mode.
(It doesn’t switch the brush per se, but it toggles the brush function, so personally I only use the Add brush and press CTRL whenever I need to subtract values)