I would recommend the first solution. Name your temporary animations consistently (maybe prefix two dashes on their names). That way, you can select them at once and delete them temporarily. Export then undo.
The modification to the json loader (SkeletonJson.cs) would be to add a name check at the very line of its ReadAnimation method:
private void ReadAnimation (Dictionary<String, Object> map, String name, SkeletonData skeletonData) {
if (name.Contains("
---
")) return;
But in this modified runtime solution, you would still incur the cost of the json deserializer going over your animations, even if they never become actual Spine Animation objects.
FWIW, I think this should be a feature:
Temporary animations are a thing. Maybe we should be able to mark animations as "Nonessential".
So you have a choice of exporting them depending on whether you want to maximize recoverability or not have any non-game-necessary data.