First of all take a look at the old pin. What is it made of? Scratch it with a file and hit it with a center punch to get an idea of the hardness. You may find that it is mild steel.
You want to replace it. Anything you use will be better than adding a section in the middle.
Secondly, what is the pin bearing against? If it is bearing against a cast surface then you would want to use a pin of mild or untempered steel. If it is turning inside of a hole punched into cold rolled mild steel then a chrome-plated or mildly hardened pin would be best.
Yes, using the smooth shank portion of a bolt would be an excellent choice. The standards for grade marking of bolts vary, but anything with hash marks on the head is a tempered alloy steel. Lean toward three to five hash marks if you can find them. Three to five indicates a bolt of grade 5 to 8 (ASTM) so is slightly hard but still very tough and drillable. More hashes are not better.
Good Luck, rScotty