Here is the latest version, using a float curve between -180 and +180:
There is a still a spring arm ‘hitch’ at +/- 90 world pitch where it seems the spring arm switches sides. I don’t think it’s gimbal lock, and I’m still puzzling about it.