I have used cylindrical dowel pins for that purpose. ISO 2338 work just fine, and you get to know which alloy you're getting. They come in all lengths and diameters, and they are beveled, which is a plus. Just get the lengths you need. I have also used them in P90s when customers didn't want adjustable screws. I've also found that they work great as, um, dowel pins when you assemble two pieces of metal that are going to come under shear stress, in custom guitar bridges / everyday mechanical repairs.
Epoxy works great for those bar magnets, just remove all of the previous glue with a razor blade and give everything a good wipe with acetone before you re-glue them!
I've been collecting those ceramic bar magnets for a while now - I get quite a few Squiers/other Asian guitars in my workshop and people usually tell me to incinerate the original pickups But they come in handy when you need a bar magnet that's magnetized vertically through its thickness.