import base64


def multibase_b64encode(data):
    """
    Follow forge's base64 urlsafe encode convention to encode bytes

    Args:
        data(bytes): data to be encoded

    Returns:
        string

    Examples:
        >>> multibase_b64encode(b'hello')
        'aGVsbG8'
    """
    if isinstance(data, str):
        data = data.encode()
    return base64.urlsafe_b64encode(data).decode().rstrip('=')