Preheat oven to 350° F. Spray a 9-inch loaf pan with baking spray or coat with butter and dust with all-purpose flour, being sure to shake out any excess flour. Set aside.
Mix butter and sugar until smooth. Add mashed bananas and beat until well blended.
Add eggs one at a time, fully incorporating after each egg.
Add flour and mix until smooth. Add baking soda, salt, and vanilla extract and stir until well combined.
Stir in nuts, if using. Pour batter into prepared pan.