I understand we should not manipulate the prototype (and I'm fine with the conventions saying that).
However, @Sbisson (WMF) noted that user scripts sometimes manipulate the prototype anyway. So it seems we should take defensive measures when looping nonetheless.