user/jszakmeister: wrap up some python-related bits in a function call

Without this, Vim will fail to parse the block correctly when Python is
not available.
wip: try vim-sexp
tmp: will drop when branch is merged