With the "Use world spacing" option enabled, the distance to generate a new stroke step is calculated in world space using the cursor position over the mesh. This avoids artifacts when sculpting across curved surfaces.
The main problem with this is that screen space and world space units for the spacing property don't match. Ideally, I would like this conversion to be automatic instead of adding another spacing property for world spacing.
Also, this is using sculpt_stroke_get_location, so it won't work when the PBVH is not available.