I actually think that the example provided in the article can be solved easy - without adding too much complexity with OOP as the author explains in the third point.
Yes, I actually think OOP is not bad :)
But I disagree with their conclusion:
That the goal is to send a post with a single JSON object and marking this task as:
> That is a very, very simple thing to do
That is a very simple thing to do if you think that you will write this code once and never have to change it to fit some new requirements.
But probably there will be changes either from your own business or because the API will change thus the task becomes:
>
And as right now when you write this code you cannot know what kind of change will come in the future the best way to move forward is to write small functions with very few conditions and open to extensions.
Thus repeating that code there is not a good solution. What if the API will request to add any new key in the payload? And those two methods (def make_hawaiian_pizza and make_pepperoni_pizza) are not in the same file and the one doing the implementation is not the current author to remember "ahh the code is duplicated so I have to change it in multiple places"?
Anyhow there are cases when duplication is good, but when composing the payload for a request is not one of them :) IMHO.
Let me add to think one more thought: the structure of code tends to be duplicated in the future. So choose not to DRY having in mind that people who will write code after you will tend to make the same choice. They will look at what you wrote and then follow a similar structure.
So don't DRY but make sure you do this in a place where you will be ok with other people increasing the number of duplicate code.