TwoBoneIK joint twisting problem

You need dual quaternion skinning as far as i know
https://github.com/AlienRenders/UnrealEngine/tree/4.20-mod