Open the save in your hex editor (e.g. HxD, but any other works as well https://mh-nexus.de/en/downloads.php?product=HxD)
Then scroll down to the end of the file and remove the lines, copy them to a new file to add them back later
It doesn't matter which tool you use to import the Mystery Gifts, the result is the same. After all the Pokemon still get generated by the game itself, not by the tool used. You could even just add the items into your bag directly and nobody would be able to tell the difference.