How to Generate Background Color of Baked Texture from Island Margins?
You can set a bigger margin without perturbing the bake itself:

So the result is:

And the models are still quite nice:

So for the api, use the margin parameter:
bpy.ops.object.bake(type='DIFFUSE', margin=512)