How can I remove a spam page from my website index?

Here’s the fix I ended up using in the collection template:

{% if collection.id or collection.products.size > 0 %}
	# {{ collection.title }}
{% endif %}

By checking for collection.id, we continue to support real collections created by the store owner. Otherwise, if this a product query by vendor, we make sure we have at least 1 product result. That way, spammers garbage won’t get outputted to the page (assuming the product count is always 0, which it should be).