Emerge fails to work complains about a bad magic number in emergehelp.pyo sorry I lost the error that came up while I fixed it by rolling back using "ebuild portage-2.1.2_rc1-r2 merge"
Maybe you just needed to remove /usr/lib/portage/pym/emergehelp.pyo for some reason. The *.pyo files are automatically regenerated by python anyway.
Somebody has hit a similar issue and provided more information. See bug 153905.
Reopen for dupe...
*** This bug has been marked as a duplicate of 153905 ***
*** Bug 153962 has been marked as a duplicate of this bug. ***