I wanted to remove ALL javascript and css from the head, but still call the wp_head function since it loads other stuff (meta, plugins, etc). Most advice tells you to use wp_deregister_script() and wp_deregister_style() to individually remove each file, but you need to know the name they were registered as, which requires you to dig deep into code. I just wanted something that removed all of them, cleared it out. I couldn’t find a function that did this, so I made a workaround.

This is not supported by WordPress, so it may not work in the future, but works as of now. Also this only works if the css and js were added the correct way (via wp_enqueue_script() and wp_enqueue_style()) – if the styles and scripts are hardcoded in the theme, you’ll have to edit those theme files directly.