Melt 2 tablespoons of butter over medium heat. Add sugar and water and stir until sugar dissolves. Continue stirring until mixture is foamy, about 2 minutes. Add rum (if using) and cook for an additional minute. Add banana slices and cook until tender, stirring occasionally, about 2 minutes.