set the context to run dissolve_degenerate from the python shell
With bmesh
Started out as a comment on answer, ended up as another answer.

Can do the above with bmesh without any need to select or switch
mode.
Loop over all objects in scene, find all the unique meshes, and list
their objects.
For each mesh, run the degenerate dissolve bmesh operator. The mesh
dimension is gained from its bounding box (local coordinates), not
its dimension which is object coordinates and involves scale.  (Else
if scale  &gt; 100 will remove all geo)

Test script, run in object mode.
import bpy
from collections import defaultdict
from mathutils import Vector

import bmesh
context = bpy.context
scene = context.scene

# meshes in scene
def mesh_dim(ob):
    bbox = [Vector(b) for b in ob.bound_box]
    return (
        bbox[6] - bbox[0]
        )

meshes = defaultdict(list)
for o in scene.objects:
    if o.type != 'MESH':
        continue
    meshes[o.data].append(o)
    
bm = bmesh.new()
for m, obs in meshes.items():
    bm.from_mesh(m)
    bmesh.ops.dissolve_degenerate(
            bm,
            dist=min(mesh_dim(obs[0])) / 100,
            edges=bm.edges,
            )
    bm.to_mesh(m)
    m.update()
    bm.clear()