Why not put a handlebar on any of the cross country bike we've seen here ?
There is more choice
One thing I learned the hard way, is that the derailleur cable on a road/gravel bike exit at the very end of the chainstay/seatstay, after the axle.
While on an MTB, it exits from the right chainstay before the axle.
If you want to put a cable actuated Eagle derailleur for instance, you'll need some 3D printing or other hackerish solution.