Matrix math to translate, rotate, scale with respect to a pivot point in Object mode
Object mode global rotation / scale around global axis thru scene cursor.
To rotate or scale about a non origin pivot point we need to change the space of our object such that its origin is the pivot point.
Can do both the scale and the rotation in one fell swoop. To just rotate set scale_factor to 1, or to just scale set the angle to zero, for either case the matrix becomes Identity.
Notice the way M is made in the reverse order, ie translates by negative pivot point to move pivot point to origin, then rotates, scales (its uniform scale), then moves the pivot point back.
import bpy
from mathutils import Matrix
from math import radians

context = bpy.context
scale_factor = 1.1
angle = 45
axis = (0, 0, 1)

scene = context.scene
pivot = scene.cursor.location

for ob in context.selected_objects:
    M = (
        Matrix.Translation(pivot) @
        Matrix.Diagonal((scale_factor,) * 3).to_4x4() @
        Matrix.Rotation(radians(angle), 4, axis) @       
        Matrix.Translation(-pivot)
        )
    ob.matrix_world = M @ ob.matrix_world