python-r1.eclass: Inline implementation loop logic into python_setup
Inline the logic needed to iterate over implementations directly into
python_setup instead of using python_foreach_impl. This is mostly NFC,
except that we iterate in reverse order now -- that is, we start at
the newest implementation and stop at the first one that works for us.
Previously we (implicitly) started at the oldest implementation, checked
all implementation and used the last one (i.e. the newest) that worked.
More importantly, the new code makes it possible to alter the logic more
easily and avoid relying on implementation of python_foreach_impl().