How is the direction of interpolation determined? I keyframed two poses and expected the arm to move upward (shortest way) like:



But what actually happens is that the lower arm moves the other way around to reach the second pose.



Is the interpolated movement always clockwise? Can the direction be influenced, or could there be some other reason for this behaviour?

I use quaternions if this matters.
The issue you are having looks like it's related to the way quaternion rotations work. 

A bone in the rest position would normally have values of 1,0,0,0, a W value of 0.001 will leave the bone in roughly the same place, yet a W value of 0.0 will flip the bone in the opposite direction.

I'm pretty sure this only happens using quaternions when all 4 values are 0.0.

So it would appear that your animation curves manage to travel from positive to negative values to cause the flipping.

An easy solution may be to add a pose in between to define a pose between the two extreme poses, instead of having it take the shortest path.