The closest thing I've ever seen to this is stuff used for braiding and knitting, but there are too many pins in this thing. It has a wooden "grip" so it's obviously meant to take some rough handling over time. There are too many pins, which makes it difficult to pierce something, so the closest I can guess is some form of early/traditional acupuncture device?
However, at the base of the pins, there are little indentations, indicating that this device could possibly have a twin or other interlocking counterpart. In that event, it could well be some form of Victorian penis torture since they're the only people crazy enough to come up with these things.