How to rotate bone group 90 degrees for all frames?
The armature should not have really have keyframes on its object at all: just its bones. Then the rotation for the object could be easily applied with Ctrl-A > Apply Rotation.

If the above is absolutely impossible, you could try something like this, but I will warn you it'll get messy fast! This will iterate over every frame and apply the rotation, then add a keyframe.

import bpy

scene = bpy.context.scene

for frame in range(scene.frame_start, scene.frame_end + 1):
    scene.frame_set(frame)
    bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
    bpy.ops.anim.keyframe_insert_menu(type='Rotation')


You could also, like I said before, do something like this (if you're fine with the rotations getting screwed for the time being):