For #19989, provide support in the python api for the script authenticat...

...ion 'sudo' option to log the script's events as a user.