This is an example of how to use the foreach method of Gtk.TextTagTable:
tagtable = self.textbuffer.props.tag_table
def foreach_func(tag, data):
print tag.props.name
tagtable.foreach(foreach_func, None)
Remember that you cannot modify the tagtable while iterating over it, so you cannot delete a tag within your foreach_func