def serialize_key(key) -> str:
    """Convert a key to its string representation.

    String inputs are assumed to be already properly serialized.
    """
    if not isinstance(key, str):
        key = repr(key)
    return key