The working hypothesis
Yes, there is scientific consensus that the human appendix has a purpose.
Since the 2007 work of Bollinger et al., the community has proceded under the working hypothesis that the appendix plays an important role in immune system function via maintenance of gut bacteria.
Pre-2007, the appendix was "thought to have some immune function based on its association with substantial lymphatic tissue, although the specific nature of that putative function is unknown". (Bollinger)
Bollinger et al. proposed that "that the human appendix is well suited as a “safe house” for commensal bacteria, providing support for bacterial growth and potentially facilitating re-inoculation of the colon in the event that the contents of the intestinal tract are purged following exposure to a pathogen".
After 2007, the work of Bollinger et al. has been cited as the starting point for more recent understanding of appendix function.
Quoting Barlow et al.:
The physiological function of the human appendix has long been a topic of debates, with the organ often considered by many a vestige of evolutionary development. However, comparative primate anatomy and new findings regarding a possible immune function give evidence to the contrary. The substantial amount of lymphatic tissue within the appendix is believed to allow for growth of the various beneficial bacterial colonies of the gut, while its long slender shape may assist in the prevention of the loss of these colonies because of diarrheal disease (Bollinger et al., 2007).
The survey paper by Barlow et al. goes on to summarize post-2007 studies that add to the hypothesis of Bollinger et al.:
[W]ith its substantial amount of lymphoid tissue, termed gut-associated lymphoid tissue (GALT), it has been postulated that the appendix may serve sort of immune function (Smith et al., 2009) Recent studies have shown that such immune tissues support the growth of beneficial bacteria in the gut (Bollinger et al., 2007). It has been found that immunoglobulin A (IgA) and mucin, proteins found in abundance in GALT, aid in the growth of bacterial colonies in the form of biofilms. More surprisingly, some groups have found that biofilms were found in higher concentrations in the appendix than any other area of the human colon (Bollinger et al., 2007; Smith et al., 2009; Im et al., 2011). From these findings, it has since been concluded that the appendix may serve as a sort of bacterial “safe house,” allowing for the survival of symbiotic flora during severe bouts of diarrhea (Bollinger et al., 2007; Laurin et al., 2011).
Guinane et al. say (internal references removed):
Is there a role for the microbiota of the human appendix in gut health? The function of the appendix as a microbial reservoir for the gut has recently received much attention. Based on this study, the appendix appears to harbors a large diversity of gut microbes, including significant amounts of “beneficial bacteria” or indicators of gut health, including the genera Bacteroides, Lactobacillus, and Bifidobacterium. It is plausible that these bacteria are present in biofilms on the epithelial layer of the appendix and may serve as a reservoir for replenishing populations that have been eradicated from the gut.
Bollinger et al. say that despite their theory, "absolute proof of such a function may be difficult to obtain since the unique nature of the human appendix may preclude the use of animals to study the issue."
Bollinger et al. mention that the appendix may be effectively unnecessary in industrialized countries with modern medical care and sanitation practices:
[T]o the extent that the primary function of the appendix is the one proposed herein, it might be argued that the human appendix is not important in industrialized countries with modern medical care and sanitation practices. Indeed, maintenance of a reserve supply of commensal bacteria in the event of infection by pathogens may be unnecessary in areas where outbreaks of enteric pathogens do not affect the vast majority of the population at any one time. Certainly, this idea is consistent with the well-known observation that appendectomy is without currently discernable long-term side effects in societies with modern medical and sanitation practices.
Barlow, A., Muhleman, M., Gielecki, J., Matusz, P., Tubbs, R. S. and Loukas, M. (2013), The vermiform appendix: A review. Clin. Anat.. doi: 10.1002/ca.22269
R. Randal Bollinger, Andrew S. Barbas, Errol L. Bush, Shu S. Lin, William Parker, Biofilms in the large bowel suggest an apparent function of the human vermiform appendix, Journal of Theoretical Biology, Volume 249, Issue 4, 21 December 2007, Pages 826-831, ISSN 0022-5193, doi: 10.1016/j.jtbi.2007.08.032.
Caitriona M. Guinane, Amany Tadrous, Fiona Fouhy, C. Anthony Ryan, Eugene M. Dempsey, Brendan Murphy, Emmet Andrews, Paul D. Cotter, Catherine Stanton, and R. Paul Ross, Microbial Composition of Human Appendices from Patients following Appendectomy, mBio, 4:1 e00366-12; Published 15 January 2013, doi: 10.1128/mBio.00366-12