First let me say that I was not able to test if setting the Wallpaper was possible, since I do not use Windows myself.
As you can see here \30
is an escaped sequence with octal value resolving to \x18
and therefore the none printable cancel character. Be sure to escape backslashes like \\
anytime when used in strings.
For the first part of the question try using the Unicode version of the function so that ctypes passes the right data type since in Python 3 the String type changed.
ctypes.windll.user32.SystemParametersInfoW(0x14, 0, 'C:\\somepic.jpg', 0)