Yeah, I played around with a rewrite of this code that basically rotates/transforms a 2D shape input into place for each "slice" in the pathextrude, and then hull()s between them for each segment. it sort of worked (aside from hull() closing off concavities).
I had one more thought about the rotation too; could you define a second path that a specific point of your profile is "locked" to?
edit: after re-reading your comments and a bit more playing around with it, I decided i don't really care too much about the rotation issues. they only seem to really present themselves when the path has a vertical, so for my purposes, I can get away with making the loop on the X-Y plane and rotating it, instead of making the loop in Y-Z or something.