Place the chickpeas and kidney beans into a large container and cover with several inches of cool water; let stand 8 hours to overnight.
Heat 1 tablespoon olive oil in a skillet over medium heat; stir in red onion. Cook and stir until onion has turned translucent, about 5 minutes. Reduce heat to low; continue cooking and stirring until onion is tender and golden brown, about 40 minutes more. Stir in dried mint; cook until onions become dark brown and crisp, about 15 minutes. Set aside for garnish.
Heat remaining olive oil in a stock pot; stir in yellow onions. Cook and stir until onion has turned translucent, about 5 minutes. Add garlic and stir until fragrant, about 1 minute. Stir in chickpeas, kidney beans, and turmeric; toss to combine. Stir in vegetable stock; simmer soup for 1 hour.
Stir parsley, cilantro, mint, scallions, and lentils into soup; simmer 30 minutes more. Break linguine into 3 sections, stir into soup, and cook at a low boil until noodles are soft, 8 to 10 minutes.
Stir 1/2 of the spinach to the soup until wilted, about 1 minute. Stir in remaining spinach and simmer for 30 minutes, stirring occasionally.
Stir flour with 3 tablespoons of the soup liquid together in a small bowl until smooth. Stir flour mixture back into soup. Continue to simmer soup over low heat, stirring frequently, until thickened, about 30 minutes.