Preparing mountain bike handlebars is quite simple, but easy to do wrong. The key is to have the ends of the bar end up very rugged, and able to slide against trees and rocks. Sliding is key so that you can actually lean against a rock face with your bar as you pedal. This technique can prevent you from crashing or help you make a section.
The key to all this is a custom delrin end plug. Here is how:
Cut to Length
I cut my example to about 25.5" These bars will be going onto a singlespeed, so a little wider is better. On a geared bike, I would cut them about an inch or so narrower.
Cutting handlebars too narrow results in extremely poor handling and leverage against the terrain. Leaving the bars too wide results in bumping trees or bridges too much, plus you are limited in terms of narrowest crossings.
Square and Clean up Ends
Make and Install Delrin Plugs
Here is a measured drawing of the part.
The 0.765 measurement of the plug on this drawing is the actual size of the bore of the bar. The plug needs to be cut about 0.002-0.003" larger than the bore so that it will be held tight via press fit.
I usually make these from white delrin, but this black delrin was convinient, so it was used.
A nice collet lathe makes things very easy.
Hammer the plugs into place and you are good to go!
Special Considerations for Carbon Fiber Handlebars
Due to the varying shape of that ID and the nature of carbon bars, the difference is that that the plug is cut for a more loose fit, then epoxied into place.
I choose to use Devcon Plastic Welder 14320. It is about the most insane epoxy for joining plastics.
Off the shelf alternatives
BlackSpire has one of the best accessories for lock-on grips. It is an end cap for the handlebars as well as clamp for the grip. If you can't do what I describe on this page, look into BlackSpire's quality canadian products.