various cleanup in osc.py

Not to merge without testing! Probably more cleaning needed even to be py3 safe.

- rename of parameters hiding builtings or keywords
- pep8 fixes
- use encode on byte() parameters