How to access bake margin from python?
The bake settings are a collection of settings available in bpy.context.scene.render.bake.

So, to access the Margin you would do:

bpy.context.scene.render.bake.margin = 16


This was a little tricky to find, but there were a few hints. 


Hovering over the Margin property showed the tooltip, which revealed that the bake options were going to be in the Scene's properties. 
Baking is linked to rendering, which made me think to look under the bpy.context.scene.render settings.


The best way to explore the Api is via blender's Python Console editor and use Autocomplete to see the available properties of a given class, e.g. typing bpy.context.scene. and pressing Ctrl+Space will reveal:

&gt;&gt;&gt; bpy.context.scene.
                      NWBusyDrawing
                      NWLazySource
                      NWLazyTarget
                      NWSourceSocket
                      active_clip
                      active_layer
                      alembic_export(
                      animation_data
                      animation_data_clear(
                      animation_data_create(
                      appended_header
                      as_pointer(
                      audio_distance_model
                      audio_doppler_factor
                      audio_doppler_speed
                      audio_volume
                      etc......
                      etc....
                      etc..