The only reference to _mcleanup is from gcrt1.o, i.e. the main program itself. So you can override it however you like. For such a niche use case, I think telling people to do that is sufficient.