You probably want to make something like this as if it were a coupling, and only 4-6" long. Then weld it, flange it or thread it back onto the pipe at each end of the metering device. This way you can work on it from both ends in the forming process; which might involve pressing from two opposite directions from the outside, and into an outer die in the other two quadrants, while pushing some sort of a die into it from each end, all at the same time. Some sort of an up-setting operation. This might also be cast or made out of a thicker walled piece of pipe so it can be fairly finely machined to an inside shape, which I would assume you would want for a metering device, as JStephen s suggested. Trying to do anything like this mid-length in a longer pipe will give you more problems than its worth, and an uncertain interior shape, and a reduced bursting strength.
The pipe stress picture will change because with a perfectly round pipe we only have a nice clean hoop stress and a longitudinal stress, due to pressure, plus any beam bending stresses. Whereas what you are talking about may change the wall thickness and also the circumferential stress picture. You have a pressure vessel with flat sides and some radiused corners over some length, and then a transition back to round. This causes a much more complex stress picture both hoop stresses and bending stresses in the circumferential direction, plus the other stresses.