Hey Slavq,
If this is a custom spline mesh, you can create a way to un-twist the spline in the opposite directions based on each point.
I would also take a look at this post to see if you can find any help suggestions or solutions as well.
Let me know if you have further questions or need additional assistance.
Thanks,