legislature. I also have a father-in-law who serves on the city council for a Utah city and loves to talk to me about what they do.
I have some experience in this area and am speaking with direct knowledge when I say that speed limits are typically set based on the limits that have been placed in other similar areas, and are often revised based on complaints and feelings (someone buzzed past a resident, and the resident has now made it their crusade to lower the speed limit on that street; a city council member is going nuts driving down this road at 25 every day, wants to raise the limit to 35).
We occasionally see master-planned communities that have roads with some degree of curvature designed to subconsciously keep drivers below a particular speed, or we warn about certain sections of the road (like sharp turns) where a lower speed is necessary...
But no, we typically don't design roads for a particular speed, and then set the limit accordingly. If we did, there would need to be physical changes to the roadway when the limit is revised...