This mod backports an attribute from 1.20.5 (generic.scale) that controls the scale of entities.
It is awailable under an id of "scale_attribute_backport:generic.scale".
You can use it in commands like:
Turn the nearest spider into a giant (5x normal size)
/attribute @e[type=spider,limit=1,sort=nearest] scale_attribute_backport:generic.scale base set 5.0
Reset the nearest spider back to normal size
/attribute @e[type=spider,limit=1,sort=nearest] scale_attribute_backport:generic.scale base set 1.0
Or you can use the Easy Mob Spawn Control mod to configure the scale of any mob globally.