Put salt, sugar, onions, leeks, carrots, celery, bay leaves, thyme, parsley, peppercorns, and 10 cups water in a large stockpot. Bring to a boil, stirring until salt and sugar have dissolved. Remove from heat; let brine cool completely.
Add turkey, breast first, to the brine. Cover; refrigerate 24 hours. Remove from brine; pat dry with paper towels. Let stand at room temperature 2 hours.
Preheat oven to 425 degrees, with rack in lowest position. Stir together melted butter and wine in a medium bowl. Fold a very large piece of cheesecloth into quarters so that it is large enough to cover breast and halfway down sides of turkey. Immerse cloth in butter mixture; let soak.
Place turkey, breast side up, on a rack set in a roasting pan. Fold wing tips under turkey. Sprinkle 1 teaspoon each salt and pepper inside turkey. Loosely fill body and neck cavities with stuffing. Tie legs together with kitchen twine. Fold neck flap under; secure with toothpicks. Rub turkey all over with softened butter; season with salt and pepper.
Remove cheesecloth from butter mixture, squeezing gently into bowl. Reserve butter mixture for brushing. Lay cheesecloth over turkey. Place turkey, legs first, in oven. Roast 30 minutes. Brush cheesecloth and exposed turkey with butter mixture. Reduce temperature to 350 degrees. Roast, brushing every 30 minutes, 2 1/2 hours more; cover with foil if browning too quickly. If making gravy, add giblets and neck to pan 1 1/2 hours after reducing temperature; roast 30 minutes, and reserve.
Discard cheesecloth; rotate pan. Baste turkey with pan juices. Roast, rotating pan halfway through, until skin is golden brown and an instant-read thermometer inserted into the thickest part of the thigh registers 180 degrees and stuffing reaches 165 degrees, about 1 hour. Transfer to a platter. Set pan with drippings aside for gravy. Let turkey stand at room temperature at least 30 minutes. Garnish, if desired.