An alternative solution would be to add a Switch before the OCIO Display, which avoids switching manually in the node graph. You can select the switch value with the mouse, and use up/down arrows to switch between inputs. I never fiddled with that, but maybe there’s a Python way to use keys to change the Switch value without having to select it.
Note that if you use two viewer inputs, you should have two ociodisplay nodes.
When using OCIODisplay, you must set the viewer input colorspace (above the viewer) to “Linear”, or the viewer will compose another transform with the OCIODisplay transform.
Never use OCIODisplay for anything else than viewing: This is not a colorspace conversion node.
The Writers have “Input colorspace” and “File colorspace” parameters and do the conversion internally, which is exactly the same conversion that is done by OCIOColorSpace, so you shouldn’t have to prepend an OCIOColorSpace (). You must set both correctly in the Writer.
If you really want to use an OCIOColorSpace node just before the writer, you must set both the “Input colorspace” and “File colorspace” in the Writer to the “Output colorspace” of the OCIOColorSpace node, so that it doesn’t perform any further conversions.
I know that OCIODisplay should be inside the viewer node (as in Nuke). This was done in the (abandonned) Natron3.