Mark freestyle edge to all objects in a collection with Python
I did some more research and found the solution.

import bpy

for obj in bpy.data.collections['wireframe'].all_objects: obj.select_set(True)

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')

bpy.ops.mesh.mark_freestyle_edge(clear=False)