bpy.data.images["ID"].save_render("XXX") changes color space
Had the same issue but found that the Sequencer (Render Properties tab, Color Management) seemed to be the cause for colorspace change when using save_render. Setting it to "Raw" fixed the issue for me.

bpy.context.scene.sequencer_colorspace_settings.name = "Raw"