As camera-shake in macro photography will be about the same as in any other kind of photography, the IS will work just as well.
I can confirm this for my 100mm f/2.8 L Macro IS USM
which I primarily use for portraits, as I still lack some important macro equipment ATM. As this is a different lens, it would still be possible that Canon went through the trouble to specifically deactivate IS in non-marco use in the 35mm f/2.8 Macro IS STM
.
This review from the-digital-picture.com does mention IS - but no limitation to macro-only. Bryan typically is very thorough with his reviews, so I would imagine that he would mention such a heavy limitation in use-cases.
The manual of the lens says at page 9:
The shorter the subject distance from the camera, the lesser the Image Stabilizer effect will be. [...]
Also, the Image Stabilizer provides image stabilization depending on shooting conditions (such as shooting still subjects, following shots, and close-ups (macro)).
So actually, it will work even better in non-macro distances (as there is more room for error - a few µm will not be noticed at 3m distance).
So my answer is that it will, most certainly, work with all kinds of photography at full 4 stops in ideal conditions. This should, in theory, apply to all Macro lenses with image stabilisation - though of course, any manufacturer could deactivate it for whichever reason they want.