Show custom data instead of 404

You may take a look at my 404 Tools plugin. I run a filter on '404_template' there. The filter function is getting the template URL as an argument, and it is still possible to send HTTP headers.

You could hook into this filter too, prepare some data you may need to print out later, change the template (eg.: to single.php) and add a do_action( 'print_my_custom_data' ); to your single.php.