Can 'Upside Down' mode be set procedurally?


I'd like to include support for an 'upside down' mode in my latest game, which will be played vertically. It sounds like what I'm after is pretty close to the Accessibility / Upside Down mode option in Settings, but personally I think it would be nice to have this kind of option as something you can choose per game. For example, I'm a left hander so there are certain games where playing in upside-down mode would be better for me, but any game where I'd need to use the A / B buttons regularly would be a pain.

Is there any way to set Upside-Down mode from within an app, which would reset after the app is quit?