With standard methods, you don't get milliseconds and 'Z', so we need to improvise. Here's a way to do it.
from datetime import datetime, timezone
s = "2020-07-29 10:27:08.494+02:00"
# parse to datetime object including the UTC offset and convert to UTC
dt = datetime.fromisoformat(s).astimezone(timezone.utc)
# format to string, excluding microseconds and UTC offset
out = dt.strftime('%Y-%m-%dT%H:%M:%S')
# add the microseconds, rounded to milliseconds
out += f"{dt.microsecond/1e6:.3f}".lstrip('0')
# add UTC offset, Z for zulu/UTC - we know it's UTC from conversion above
out += 'Z'
This will give you
print(out)
>>> 2020-07-29T08:27:08.494Z