How to specify number of cuts for subdivision modifier in python
There is an operator that sets subdivision level for an object and adds the Subsurf modifier if it does not exist:

bpy.ops.object.subdivision_set(level=4)


You can call it with a button like any other operator:

self.layout.operator("object.subdivision_set", text ="Add subdivision", icon="MOD_SUBSURF").level=4