improve fastCodeAt for python