optimize method string ans str_escape

Especially method string is now five perent faster. Tested with panda's
35kB projects.json.