Thaw the turkey completely in the refrigerator (24 hours per 5 pounds) or in cold water (30 minutes per pound), changing the water every 30 minutes.
Remove the giblets and neck from the turkey cavities. Rinse the turkey inside and out and pat dry with paper towels.
Prepare the brine: In a large pot, combine water, salt, sugar, peppercorns, rosemary, thyme, garlic, and onion. Bring to a simmer until salt and sugar are dissolved. Let cool completely.
Submerge the turkey in the brine in a food-safe container or bag. Refrigerate for 12-24 hours.
Remove the turkey from the brine and pat dry with paper towels. Discard the brine.
In a small bowl, combine salt, pepper, dried thyme, dried rosemary, dried sage, garlic powder, onion powder, and paprika.
Rub the seasoning mixture generously all over the turkey, inside and out. Lift the skin of the breast and rub some of the seasoning directly onto the meat.
Preheat the oven to 325°F (160°C).
Place the turkey on a roasting rack in a roasting pan. Brush with melted butter.
Roast for 3-4.5 hours, or until a meat thermometer inserted into the thickest part of the thigh registers 165°F (74°C). Baste with pan juices every 30-45 minutes.
Remove the turkey from the oven and let it rest for at least 30 minutes before carving. Tent loosely with foil to keep warm.
While the turkey rests, make the gravy: Pour off excess fat from the roasting pan, leaving about 1/4 cup of drippings. Place the pan on the stovetop over medium heat.
Whisk in flour and cook for 2-3 minutes until smooth and golden brown.
Gradually whisk in chicken or turkey broth, whisking constantly to prevent lumps. Bring to a simmer, then reduce heat and simmer for 10-15 minutes, or until the gravy has thickened.
Season with salt, pepper, and Worcestershire sauce (if using). Strain through a fine-mesh sieve for a smoother texture (optional).
Carve the turkey and serve with gravy and your favorite Thanksgiving side dishes.