Heat butter over medium heat until melted. Add garlic and shallot. Cook for 5 minutes.
Add all remaining ingredients to the pot except for the kale, stir to combine. Bring to a simmer - being careful not to boil. Simmer for 10 minutes.
Mash about ¼ of the beans using a potato masher (a jar or spatula would also work). Simmer for an additional 5-10 minutes.
Turn heat to low, add kale and stir to combine until wilted. Turn off heat and let beans cool for at least 5 minutes, they will thicken as they cool.
If you are making the pesto, add all pesto ingredients to a food processor and process until smooth. Stop to scrape the sides down as needed.
Top beans off with pesto and red pepper flakes if using, serve and enjoy.
