def _deep_deannotate(element):
    """Deep copy the given element, removing all annotations."""

    def clone(elem):
        elem = elem._deannotate()
        elem._copy_internals(clone=clone)
        return elem

    if element is not None:
        element = clone(element)
    return element