I know this is an old topic, but if anyone is looking to remove the search box from 404 pages and not just hide it with css, the following snippet does the trick.
add_filter( 'generate_404_text','generate_custom_404_text' );
function generate_custom_404_text()
{
return '';
}
add_filter( 'get_search_form','my_remove_search_form' );
function my_remove_search_form()
{
$template = $GLOBALS['template'];
$template_file = substr($template, strrpos($template, '/') + 1);
if ($template_file === '404.php') {
return '';
}
}