WordPress – Bulk remove categories

One might think this should be an easy task to do on such succesful CMS as WordPress is.
But it turns out that there is no native way how to bulk remove categories, especially not from custom post types, or pages as you sometimes might end up with.. Yes, pages can have categories as well.

And so to get rid of the categories from posts, pages, what ever you have.. do this:

Put it for example in to your index.php, run it one, delete the code.
That is all there is to it.

Such an basal function and nowhere to be found.