How to deal with Shapes from self-crossing SVG path?

SVG intersected curves

Is there a way to deal with this kind of shapes, it’s a simple drawing in inkscape with intersected curves, you’ll see what I mean if you import it in the Three.js editor, apparently it’s a common problem even blender was struggling with it until recent updates and it’s not completely solved.

I’m wandering if there is a way to reshape the path programmatically before handing it to the SVGLoader.