The below code will rotate a selection of objects around an arbitrary location (using the active object's location here) by the chosen angle (45 in this example). I cobbled this code together from a few places but I don't fully understand how to manipulate matrices very well yet.

If you create a few objects and press **run script** you'll see 45 degrees is added to the objects while transforming them around the active object. This is almost exactly what I need minus one issue. I need this code to **set** the rotation value to 45 (or whatever arbitrary value) when the script is run ***not*** add 45 degrees to the selection of object's matrices. 


    import bpy
    from math import radians
    from mathutils import Matrix
    
    ob = bpy.context.object
    rot_point = ob.location
    rot_angle = 45
    rot_axis = 'Y'
    
    mat = (Matrix.Translation(rot_point) *
           Matrix.Rotation(radians(rot_angle), 4, rot_axis) *
           Matrix.Translation(-rot_point))
    
    
    for obj in bpy.context.selected_objects:
        obj.matrix_world = mat * obj.matrix_world