<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_all_listeners(self, event=None):
 """Remove all functions for all events, or one event if one is specifed. :param event: Optional event you wish to remove all functions from """

        if event is not None:
            self._registered_events[event] = OrderedDict()
        else:
            self._registered_events = defaultdict(OrderedDict)