At the phonetic level, nobody really know how complex it "can" be. As you presumably know, F0 is a windowed function, and if we take a standard window of 10 msc., you can get a huge number of integer vectors for durations up to 400 msc. But it's physically impossible to change F0 from 100 Hz to 400 Hz within the course of 10 or 20 msc. There are also very many sequences of pitch-difference which people cannot distinguish (e.g. 100-101-100 versus 100-100-100).
The standard theory of tone contours is that a tone begins at some level, and then goes up or down when a new level specification is encountered. For example, the sequence bábàbābȁ has the levels H, L, M and XL, in that order, and each on a separate vowel "a". A contour the same w.r.t. the tonal points, the difference being that there are two or more levels specified on a single vowel. Thus a (simple) falling tone would be a sequence H+L on one vowel and a rising tone would be L+H on one vowel.
But many languages have more than just two levels, so combinations like L+H vs L+M, M+L vs H+L and so on are also well attested. If there are 5 levels, then you can get 20 contours (sequences of two distinct tone levels). We also know from observation that contours can have 3 defining points so 80 contours is a theoretical possibility. At this point, one might insist that a contour can only have 3 defining levels. I know of one counterexample, Lomongo, which is said to have 4-element contours, and will not commit to the veracity of the claim.
Even with a limit of 3 defining points, no language comes close to attesting that level of complexity. One generalization that seems to hold of known 3-tone complexes is that there is always a change in direction, that is you don't just "go up a little then go up a lot", instead contours are of the form "go (up, then) down, then up, then down...", and there can be distinctions in how far on goes up or down. Using numeric values for levels with 1 being the lowest, you may find 1-2-1, 1-3-2, but not *1-2-5.
Theoretically, anything is computationally possible, but once you factor in perception, very many distinctions are not and cannot actually realized in languages, because they are not reliably perceptible. Even though computers can compute F0 in a very narrow window, we use a much wider window for speech perception.
Consonants can also have tone. This is fairly common in the case of sonorants (especially in the syllable coda), not so common but attested in the case of voiced obstruents, for example Logoori and Luganda. Phonologically speaking though not phonetically, even voiceless obstruents can have tone (as in Logoori and Luganda), but the evidence is indirect, being based on what the tones do to pitch of surrounding voiced segments.