<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def force_bytes(value):
 """ Forces a Unicode string to become a bytestring. """

    if IS_PY3:
        if isinstance(value, str):
            value = value.encode('utf-8', 'backslashreplace')
    else:
        if isinstance(value, unicode):  # NOQA: F821
            value = value.encode('utf-8')

    return value