I usually just put _x at the end of the attribute name. Then the attribute is ignored because it's unknown. So if I wanted to comment out the id attribute from this element:
I would change it to this:
This also has the advantage of being able to search for "_x=" to find all commented attributes.