def section(title, adornment, overline = False):
    """Generate a section title with the specified adornment.

    Args:
        title (str): The title of the section, *without* terminating \n
        adornment (str): The character used for over/underlining the title
        overline (bool): Whether to overline (True) or just underline (False)

    Returns:
        str. The adorned title.
    """
    result = ''
    line_len = len(title)

    if overline:
        # Inset the title
        line_len += 2
        title = ' ' + title

        result += adornment * line_len
        result += '\n'

    result += title
    result += '\n'

    result += adornment * line_len
    result += '\n\n'

    return result