A sequence of 90-degree rotations with Python
To do this with matrix multiplication &amp; globally.  As for the "wobbling" do  you mean the interpolation?

import bpy
from math import radians
from mathutils import Matrix

mat_rot_x = Matrix.Rotation(radians(90.0), 4, 'X')
mat_rot_mx = Matrix.Rotation(radians(-90.0), 4, 'X')
mat_rot_y = Matrix.Rotation(radians(90.0), 4, 'Y')

obj = bpy.data.objects["Sphere"]
obj.animation_data_clear()

obj.rotation_euler = [0, 0, 0]
bpy.context.scene.frame_set(1)
obj.keyframe_insert(data_path="rotation_euler", frame=1)

obj.matrix_world *= mat_rot_x
obj.rotation_euler = obj.matrix_world.to_euler()
obj.keyframe_insert(data_path="rotation_euler", frame=20)

obj.matrix_world *= mat_rot_y
obj.keyframe_insert(data_path="rotation_euler", frame=40)

obj.matrix_world *= mat_rot_mx
obj.rotation_euler = obj.matrix_world.to_euler()
obj.keyframe_insert(data_path="rotation_euler", frame=60)