hat is the best to use and why ?
The template version requires more work out of the compiler and doesn't really accomplish anything extra. In general, I'd lean towards avoiding the template version unless you can qualify exactly what benefit you get from it. The template version is also technically generating a function call which can have a big runtime overhead in some build configuration, though that's not likely to be relevant to this use case.
A macro can of course forward to a template if things like ICC requires it. It's very common to put all the definitions for things like UNUSED_PARAM into a header file that has a bunch of compiler/platform detection (or uses a configuration header that has that pre-generated) to use the most appropriate implementation, as some of these things will vary heavily by compiler or platform.
Remember, C++ as a language has absolutely no notion of an unused variable warning. That's something that compilers add on to try to be helpful. Because it's not part of C++, there's no standard on how those warnings work or how they should be suppressed. As with most anything that isn't firmly locked down and etched in stone, there isn't a single "best" way to do it.
Another option I'm somewhat in favor of is to just turn off the unused parameter warning. I haven't seen it actually be useful in solving either a correctness or a performance problem in... well, ever that I can recall.