Removing unnecessary wordpress files

If you don’t use any 3rd services such as XMLRPC | REST API | oEmbed | Windows Live Writer, removing those lines/headers doesn’t affect anything to your site.

Those lines of code is the best way to archive what you want. To remove xmlrpc.php?rds, you need another line:

remove_action('wp_head', 'rsd_link');

Put all of them in your functions.php or some where so that they are called before the wp_head action is fired.