import uuid


def gen_uuid(prefix: str=''):
    """
    Generate a UUID4 String with optional prefix replacing the first len(prefix)
    characters of the UUID.

    Parameters
    ----------
    prefix : [str]
        Optional string prefix to be prepended to the generated UUID

    Returns
    -------
    str:
        UUID String of length 32
    """
    base_uuid = uuid.uuid4().hex
    return '{}{}'.format(prefix, base_uuid[len(prefix):])