There are really two St. Cosmos or two versions: the "randy" St. Cosmos, aka the "modern Priapus," and the saintly martyred St. Cosmos. Pynchon, it seems, is connecting Randolph St. Cosmo to the former.
From this website, we get the "official" St. Cosmo (aka St. Cosmas) and Damian (aka Damiano), martyrs and saints:
- Saints Cosmas and Damian. The twin brothers, Cosmas and Damian, were born around the middle of the third century in Egea, a city in Cilicia, belonging to the Patriarchate of Antioch, in Asia Minor. Their parents were of noble blood, and heroic Christians. Antimo, Leonzio and Euprepio, their younger brothers, were inseparable from them throughout life. All practiced medicine with a marked spirit of love and service, making of their profession a mission of help to suffering humanity. From their youth, seeing the state of moral misery and the errors of paganism, they set about enlightening others in the truths of the Christian faith they practiced with such zeal and ardor.
- Thus, the prefect Lisia, through his office as governor of Sryria and, therefore, the supreme magistrate of Rome, sentenced them to death by means of decapitation, along with their younger brothers. The date of their martyrdom is universally considered to be September 27, 303. The place is controversial either Egea of Cilicia, their native city, or Ciro of Syria, where they were buried. Over their tombs a basilica was constructed, and later enlarged by Constantine.
- They are the official patrons of doctors and health workers because of the Christian spirit with which they worked, and because of their thaumaturgic power, used on behalf of human suffering and for the allieviation of the problems of the sick of body and of spirit.
- Priapus, in Greek mythology, son of Dionysus (or Adonis or Hermes) and Aphrodite (or Chione). He is unknown to Homer and Hesiod. The chief seat of his worship was the coast of the Hellespont, especially at Lampsacus, which claimed to be his birthplace. Thence his cult extended to Lydia, and by way of the islands of Lesbos and Thasos to the whole of Greece (especially Argolis), whence it made its way to Italy, together with that of Aphrodite. Priapus is the personification of the fruitfulness of nature. Sailors invoked him in distress and fishermen prayed to him for success. He gradually came to be regarded as the god of sensuality. His symbol was the phallus, an emblem of productivity and a protection against the evil eye. The first fruits of the gardens and fields, goats, milk and honey, and occasionally asses, were offered to him. He was sometimes represented as an old mail, with a long beard and large genitals, wearing a long Oriental robe and a turban or garland of vineleaves, with fruit and bunches of grapes in his lap. Amongst the Romans, rough wooden images, after the manner of the hermae, with phallus stained with vermilion, were set gardens. His image was placed on tombs, as symbolizing the doctrine of regeneration and a future life, and his name occurs on sepulchral inscriptions. In his hand he carried a bill-hook or club, while a reed on his head, shaking backwards and forwards in the wind, acted as a scarecrow. 
The Fete of St. Cosmo and Damiano as late as 1780, was celebrated at Isernia, on the confines of Abruzzo, in the Kingdom of Naples, as described below:
- On the 27th of September, at Isernia, one of the most ancient cities of the Kingdom of Naples, situated in the Province called the Contado di Molise, and adjoining to Abruzzo, an annual Fair is held, which lasts three days. The situation of this Fair is on a rising ground, between two rivers, about half a mile from the town of Isernia; on the most elevated part of which there is an ancient church, with a vestibule. The architecture is of the style of the lower ages; and it is said to have been a church and convent belonging to the Benedictine Monks in the time of their poverty. This church is dedicated to St.Cosmus and Damianus. On one of the days of the Fair, the relics of the Saints are exposed, and afterwards carried in procession from the cathedral of the city to this church, attended by a prodigious concourse of people. In the city, and at the fair, ex-voti (votive offering) of wax, representing the male parts of generation, of various dimensions, some even of the length of a palm, are publicly offered to sale. There are also waxen vows, that represent other parts of the body mixed with them; but of these there are few in comparison of the number of the Priapi. The devout distributors of these vows carry a basket full of them in one hand, and hold a plate in the other to receive the money, crying aloud, "St. Cosmo and Damiano!" If you ask the price of one, the answer is, più ci metti, più meriti: "The more you give, the more's the merit."
- The ceremony finishes by the canons of the church dividing the spoils, both money and wax, which must be to a very considerable amount, as the concourse at this fête is said to be prodigiously numerous.
- The oil of St. Cosmo is in high repute for its invigorating quality, when the loins, and parts adjacent, are anointed with it. No less than 1400 flasks of that oil were either expended at the altar in unctions, or charitably distributed, during this fête in the year 1780; and as it is usual for every one, who either makes use of the oil at the altar, or carries off a flask of it, to leave an alms for St. Cosmo, the ceremony of the oil becomes likewise a very lucrative one to the canons of the church. Source
Sir W. Hamilton's account of the worship paid to St. Cosmo and St Damiano is very curious:
- On the 17th September, at Isernia, one of the most ancient cities of the kingdom of Naples, situated in the Contado di Molise, and adjoining the Abuzzo, an annual fair is held which lasts three days. In the city and at the fair, ex-votos of wax, representing the male parts of generation, of various dimensions, sometimes even of the length of a palm, are publicly exposed for sale. There are also waxen vows that represent other parts of the body; but of these there are few in comparison with the Priapi.
- The distributors of these vows carry a basket full of them in one hand, and hold a plate in the other to receive the money, crying out, "Saints Cosmos and Damiano!" If you ask the price of one, the answer is "Più ci metti, più meriti" the more you contribute, the more the merit The vows are chiefly purchased by the female sex and they are seldom such as represent legs, arms, etc., but most commonly the male parts of generation. The person who was at the fête in the year 1780, and who gave me this account (the authenticity of which has since been confirmed to me by the Governor of Isernia), told me also he heard a woman say, at the time she presented a vow, "Santo Cosmo, benedetto, cosi lo voglio!" "Blessed St. Cosmo, let it be like this!" The vow is never presented without being accompanied by a piece of money, and is always, kissed by the devotee at the moment of presentation.
- But, as might naturally be expected, this ghostly voluptas does not suffice to fructify barren women; and, consequently, another ceremony, doubtless more efficacious, was required. The votaries who resorted to this fair slept there for two nights, some in the Church of the Capuchin friars and the others in that of the Cordeliers; when these two were insufficient to contain all the devotees, the Church of the Hermitage of St Cosine, received the overflow.
- In the three edifices the women during the two nights were separated from the men, the latter lying under the vestibule, and all the others in the chapels. These, whether in the Church of the Capuchins, or in that of the Cordeliers, were under the protection of the father guardian, the vicar, and a monk of merit. In the Hermitage it was the hermit himself who watched over them. From this it may easily be imagined how the miracle was effected without troubling St. Cosmo and St Damiano, as well as that the virtue possessed by these two saints extended to young maidens and widows.
- In the neighbourhood of Brest stood the chapel of the famous Saint Guignole or Guingalais, whose Phallic symbol consisted of a long wooden beam, which passed right through the body of the saint, and whose forepart was strikingly characteristic. The devotees of this place, like those of Puy-en-Velay, most devoutly rasped the extremity of this miraculous symbol, for the purpose of drinking the scrapings, mixed with water, as an antidote against sterility; and when, by the frequent repetition of this operation, the beam was worn away, a blow from the mallet in the rear of the saint propelled it to the fore. Thus, although it was being continually scraped, it appeared never to diminish, a miracle due exclusively to the mallet.
- I will conclude this hasty sketch of the Priapic cult with a brief description of the Dionysia, or festivals celebrated in honour of Bacchus, which throw considerable fight on this worship. They were brought from Egypt into Greece by Melampus, the son of Amithaon, and the Athenians celebrated them with more pomp than the other Greeks. The principal Archon presided over diem, and the priests who celebrated the religious rites occupied the first places in the theatre and in the public assemblies. Originally these festivals exhibited neither extravagance nor splendour, they were simply devoted to joy and pleasure within the houses; all public ceremonies were confined to a procession, in which there appeared a vase full of wine and, wreathed with vine leaves, a goat, a basket of figs and the Phalli. At a later period this function was celebrated with greater pomp; the number of priests of Bacchus increased; those who took part therein were suitably dressed, and sought by their gestures to represent some of the customs which faith attributed to the god of wine. They dressed themselves in fawn skins; they wore on head a mitre; they bore in hand a thyrsus, a tympanum or a flute and their brows were wreathed with ivy, vine leaves and pine-branches. Some imitated the dress and fantastic postures of Silenus, of Pan and of the Satyrs; they covered their legs with goatskins, and carried the horns of animals; they rode on asses, and dragged after them goats intended for sacrifice. In the town this frenzied crowd was followed by priests carrying sacred vases, the first of which was filled with water, then followed young girls selected from the most distinguished families, and called Canephori, because they bore small baskets of gold full of all sorts of fruit, of cakes and of salt; but the principal object among these, according to St Croix, was the Phallus, made of the wood of a fig tree. (In the comedy of the Acharnians, by Aristophanes, one of the characters in the play says, 'Come forward a little, Canephoros, and you, Xianthias, slave, place the Phallus erect.')
- After these came the Periphallia, a troop of men who carried long poles with Phalli hung at the end of them; they were crowned with violets and ivy, and they walked repeating obscene songs. These men were called Phallophori; these must not be confounded with the Ithyphalli, who, in indecent dresses and sometimes in women's costume, with garlanded heads and hands full of flowers, and pretending to be drunk, wore at their waist-bands monstrous Phalli made of wood or leather; among the Ithyphalli also must be counted those who assumed the costume of Pan or the Satyrs. There were other persons, called Lychnophori, who had care of the mystic winnowing-fan, an emblem whose presence was held indispensable in these kinds of festivals. Hence the epithet "Lychnite," given to Bacchus.
- Outside the town, the more respectable persons, the matrons and modest virgins, separated themselves from the procession. But the people, the countless multitude of Sileni, of Satyrs and of Nymph-bacchantes, spread themselves over the open spaces and the valleys, stopping in solitary places to get up dances or to celebrate some festival and making the rocks re-echo with the sound of drums, of flutes, and more especially with cries, constantly repeated, by which they invoked the god: "Evohé Sabæe! Evohé Bacche! O Iacche! Io Bacche!" The first of these words recalls the words with which Jupiter encouraged Bacchus when, in the Giants' War, the latter defended his father's throne. Source
Sir William Hamilton, British Minister at the Court of Naples, declares that in 1780, Isernia, a community of Christians in Italy, worshiped with phallic ceremonies the pagan god Priapus under the name of St. Cosmo. (See Two Essays on the Worship of Priapus, by Richard Payne Knight.)
Mason & Dixon
In Mason & Dixon, Pynchon has the Veery brothers, Cosmo and Damian, who are professional effigy makes in Philadelphia! And, just to make it interesting, "He's a rare Wax Artist, our Cosmo is." (p. 290) (Note the wax ex voti, above, offered by the women to St. Cosmo...)