This is going to be fairly slow.  String comparisons are not exactly blazing fast, and there are a lot of variables in any given object.

I do not know but I imagine the byond builtin hasvar(obj,varstring) would be faster than a brute list search.