Not sure what you are asking for exactly, but you first get the set of all book ids in the current virtual library. THen after that call
Code:
ans = set()
for book_id in book_ids:
ans |= {x for x in db.new_api.field_ids_for('tags', book_id)}
and use get_id_map() to convert the ids from ans into names.