Top of the mast!!!
I wouldn't go that far?
Maybe mount it mear the top of the mast. But not on top. The top of the mast is where the VHF antenna and anchor light is!!
Also if you happen to live in a lightning prone area. That would not be a very good idea!!
If someone where to mount a windvane device or something like that on the upper region of the mast. I'd put it up around between 3/4 and almost the very top of the mast. But not the very top?
Most people mount their windvanes on a pole of the stern area of their boats. If I was to mount any windvane on my boat. That's where I'd mount mine!!