What you’re trying to do won’t work because the hash() function is one-way, there is no way to get the string back from it.
If all of your buttons are under a common parent node you could try what @Dragosha suggested and only pass the id of said parent node, then get all the ids you need by looping through the children.
A bit of a more counter-intuitive solution to pass a string to your script would be to create an invisible Text node somewhere in the gui and write the comma-separated id list in there. Then you can retrieve it with gui.get_text().
Of course, the intended way of doing this is through messages, which would require code. A great explanation on why it was designed this way you can find here: