Is there a way to access a collection's name other than through bpy.context so it can be renamed?
Collections are ID objects
In blender any ID object is stored in
bpy.data Objects in
bpy.data.objects meshes in
bpy.data.meshes collections in
bpy.data.collections etc etc
To rename a collection named "Bob" to "Frank"
import bpy col = bpy.data.collections.get("Bob") if col: col.name = "Frank"
Note if there is already a collection named "Frank" then numbers are appended "Frank.001"... as per unique naming convention.