Instead of fixing GAP by backporting an upstream commit, we might also consider updating sagemath to include said commit. The first release to contain that is 8.8. I started https://salsa.debian.org/science-team/sagemath/merge_requests/12 in the hope that it helps getting that upgrade off the ground.