Mounting Ceiling Fan to Exposed Beam
I use a 4" hole saw, drill it in to box depth and chisel out the lumber.
Another option would be to cut a piece of sheet metal the diameter of the canopy and hang the fan bracket over it, directly on the beam. This is not an approved method but it will be more safe than a pan box becase the entire area under the canopy will be covered.
In real life, if you just hung the fan bracket on the beam, it would not be much more dangerous than using a pan box. The pan box still leaves a 1/2" ring of exposed wood around it under the canopy where the splices are.