import html


def clean_input(val: str) -> str:
    """Clean input by escaping special characters and removing null characters"""
    val = html.escape(val)
    return str.replace(val, "\x00", "", -1)