Please update the ebuild to version 3.1.5 to match pyopengl. Renaming the old ebuild and removing the sed line from it worked. Reproducible: Always
https://github.com/gentoo/gentoo/pull/15539
Given I'm about to stabilize 3.1.6, I suppose this is fixed.