Py: optimize length lookups; Runner: infer var types on declarations for readability