What is relation between edit_bone roll and and pose.bone rotation_quaternion?
I managed to overcome roll differences by resetting roll on all bones to zero without affect final pose (much). Procedure is little hackish but it works:


create armature clone in same place as donor one
add rotation constraint in WORLD coordinates on each bone of clone
reset roll to 0 on all edit bones of clone (bones will do thier best to stay intact due constraint)
execute "Apply Visual Transform to Pose" - bpy.ops.pose.visual_transform_apply() - on clone bones to flush contraints into real bone properties
remember clone rotation_quaternions and delete clone
set roll=0 and rotation_quaternion to remembered values on original armature.


That is all. After that we have almost the same pose, but all roll values on each bone are zeroed out

Code: https://gist.github.com/IPv6/0209f6ff4e013c575ca69ef0fbc0fe14