def election_slug(state, start_date, race_type, special=False, **kwargs):
    """
    Generate a standardized election identifier string.

    Args:
        state: Lowercase state postal abbreviation.  For example, "md".
        start_date: Start date of election, in the form YYYY-MM-DD. Required.
        race_type: Race type, for example "general" or "primary".  Required.
        special: Boolean indicating whether the election is a special election.
                Default is False.

    Returns:
        String formatted like: ``{state_abbrev}-YYYY-MM-DD-(special)-{race_type}``

        For example, "ar-2012-05-22-primary".

    """
    bits = [
        state.lower(),
        start_date,
    ]

    if special:
        bits.append('special')

    bits.append(race_type.lower())

    return "-".join(bits)