Copy a new one.
For the case where the desired result in target identical to source could simply assign it the same bones as the other with a copy of A's armature data, this will not only copy all edit bone transforms, but also all relations, parent, connected etc.
B_obj.data = A_obj.data.copy()
or even use the same armature
B_obj.data = A_obj.data
Converting Space.
Can see issues with simply copying local matrices from to when bone names match but not much else does.
To allow for changes in space between the rigs, like for example rig b having a different origin to rig a. see Python, How to get pose bone to rotate with another pose bone from a different armature? Finding Rotational difference re using convert_space to create matrices to copy from one rig to another. eg in this case to take the local matrix of bone A and convert it to a local space matrix of bone B
matrix_localof an armature bone is defined by the head, tail and roll of an edit bone. – batFINGER Aug 18 '21 at 14:38b.head == b.matrix_local.translationandb.tail == b.matrix_local @ Vector((0, b.length, 0))Any changes are not written back to data while in edit mode. (Whereas mesh has anupdate_from_editmodemethod, to do this) not aware of an update method other than toggle edit mode, for bones. – batFINGER Aug 18 '21 at 16:21