Trying to speed this process up

I’m working on a script that involves contouring a shape, overlaying those contours over top each other, and getting the difference between some of them. Whenever I run this script it takes almost 10 minutes to do anything. The profiler shows that most of the time is bunched up into a couple of RInt functions. They are having to perform multiple intersections which make sense but I was wondering if there was any way I could speed this task up.

Any thoughts? This is still taking a lot of time on our end. I do notice that this slows down significantly with curves, where as straight lines are okay.