An inclusive search for nonresonant signatures of beyond the standard model (SM) phenomena in events with three or more charged leptons, including hadronically decaying τ leptons, is presented. The analysis is based on a data sample corresponding to an integrated luminosity of 138 fb-1 of proton-proton collisions at s=13 TeV, collected by the CMS experiment at the LHC in 2016-2018. Events are categorized based on the lepton and b-tagged jet multiplicities and various kinematic variables. Three scenarios of physics beyond the SM are probed, and signal-specific boosted decision trees are used for enhancing sensitivity. No significant deviations from the background expectations are observed. Lower limits are set at 95% confidence level on the mass of type-III seesaw heavy fermions in the range 845-1065 GeV for various decay branching fraction combinations to SM leptons. Doublet and singlet vectorlike τ lepton extensions of the SM are excluded for masses below 1045 GeV and in the mass range 125-150 GeV, respectively. Scalar leptoquarks decaying exclusively to a top quark and a lepton are excluded below 1.12-1.42 TeV, depending on the lepton flavor. For the type-III seesaw as well as the vectorlike doublet model, these constraints are the most stringent to date. For the vectorlike singlet model, these are the first constraints from the LHC experiments. Detailed results are also presented to facilitate alternative theoretical interpretations.