This is a deep dive into the rigging and weight painting stage. One of the ways is to add an extra twist bone to fix the distortion based on the particular hand bone rotation. Here, take a look at this basic fix.