I want you to modify the method.
Add a delete_tag method in the requester where you would do the following part of your code:
 my_tag = self.req.get_tag(tag)
 vtree = self.req.get_tasks_tree()
 taskid_list = vtree.get_nodes(withfilters=['active'])
 for item in taskid_list:
     task = self.req.get_task(item)
     task.remove_tag(my_tag.get_name())
In that also, no need to get the list of all tasks, you can use get_related_tasks() method of the tag.