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.