<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def escape_html(text, escape_slash=False):
 """ Binding for Hoedown's HTML escaping function. The implementation is inspired by the OWASP XSS Prevention recommendations: .. code-block:: none & --> &amp; < --> &lt; > --> &gt; " --> &quot; ' --> &#x27; / --> &#x2F; when escape_slash is set to True .. versionadded:: 2.1.0 """

    byte_str = text.encode('utf-8')
    ob = lib.hoedown_buffer_new(OUNIT)
    lib.hoedown_escape_html(ob, byte_str, len(byte_str), int(escape_slash))

    try:
        return to_string(ob)
    finally:
        lib.hoedown_buffer_free(ob)