Make GPU_viewport_colorspace_set() const-crrect w.r.t view_settings. Instead of doing in-place modifications of the view_settings argument with restoring them later introduce new function for copying view settings which keeps curve mapping unchanged in the destination. Should be no functional changes. Pull Request: https://projects.blender.org/blender/blender/pulls/138189