With gimp fu, I can save the content of one layer (at least, that is how I interprete the definition of gimp_file_save because it takes the parameter
gimp_file_save
What I found easiest was to flatten the image then just save using the first layer:
img.flatten() pdb.gimp_file_save(img, img.layers[0], 'image.jpg', '?')