python: Make message-writing more generic

Make the use of oprot & self._oprot generic, to remove some complexity
from the generator