How to smooth the appearance of a specified subset of faces without topology changes with a script?
Set your object to smooth shading.

Add an edge split modifier. Apply it if you wish.

Depending on the angle setting in the edge split modifier, surfaces will appear smooth shaded preserving sharp edges.

Internally, the modifier splits edges based on the angle of the adjacent faces.

This will add the edge split modifier and "apply" it. The topology will change.

if 1 == 1:
    name = "pole_piece"

    me = bpy.data.meshes.new(name)
    ob = bpy.data.objects.new(name, me)

    scene = bpy.context.scene
    scene.objects.link(ob)

    me.from_pydata(verts, [], faces)

    bpy.data.objects[name].select = False
    bpy.data.objects[name].select = True

    for p in ob.data.polygons:
        p.use_smooth = True
    mod = ob.modifiers.new("edge", type='EDGE_SPLIT')
    ob.data = ob.to_mesh(scene, True, 'PREVIEW')
    ob.modifiers.remove(mod)