Check out Fedify. There are still advantages to bespoke protocol implementation, but this is the closest we've gotten so far to "protocol-in-a-box", and it's great.
As a biased[0] party I must mention that the Go programming language has at least one and a half libraries in the form of Go-Fed[1] and Go-ActivityPub[2].
[2] https://github.com/go-ap
[1] https://github.com/go-fed
[0] I am the dev of the later one.