I suggest you to read https://www.cineversity.com/wiki/Python%3A_User_Data/ and https://developers.MAXON.net/docs/Cinema4DPythonSDK/html/modules/c4d/DescID/index.html?highlight=descid
Basicly descId[1].id give us the current id of the userdata. So I check if this id is inside the list to hide, if it's inside the list to hide then I Hide this.
For more optimization I suggest you to read this topic which can be very informative also http://www.plugincafe.com/forum/forum_posts.asp?TID=13629