python3: move from using func_name to __name__
Previously reviewed as D964, but required some fixups and therefore
seems to need a new revision.
Differential Revision: https://phab.mercurial-scm.org/D1065
ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\nOK.