Custom function for search form

bloginfo( 'template_url' ) will print the URL to the page and break the return of your function.

You need to use get_bloginfo( 'template_url' ) to concatenate the result into the string.

function clarity_wpsearch($form) {
    $form = '<form role="search" method="get" id="searchform" action="' . home_url( "https://wordpress.stackexchange.com/" ) . '" >
    <label class="screen-reader-text" for="s">' . __('Search for:', 'claritytheme') . '</label>
    <input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="'.esc_attr__('Search the Site...','claritytheme').'" />
    <input type="image" alt="'. esc_attr__('Search') .'" src="'. get_bloginfo( 'template_url' ) .'/images/search.png" />
    </form>';
    return $form;
}