How to activate the STL import/export addon from the commandline?
bpy.ops.export_mesh.stl() will be present without explicitly enabling the add-on. io_mesh_stl is enabled already by default, re-enabling it seems to be the problem here.

Exactly why you get that error is not something I'd spend much time on as a user, considering the fact that it can be avoided by not re-enabling the add-on.