This is slow because it first converts the list to Sage and then
iterates through the element warppers and compares:
sage: libgap(1) in libgap.List([1,2,3])
True
The GAP "in" operator is also available as a function IN()
gap> IN(1, [2,3]);
false
gap> IN(2, [2,3]);
true
You can use that in Sage as
sage: contains = libgap.function_factory('IN')
sage: contains(libgap(1), libgap.List([1,2,3]))
true
sage: _.sage()
True
We should probably expose that as the __contains__ method in libgap
elements, then the naive "libgap(1) in libgap.List([1,2,3])" would be
fast, too.