True, but Hammestein was writing for a definite character (I don’t know what song you’re quoting, but I’ll guess that it’s a woman’s line), while Shakespeare’s sonnets were much closer to autobiographical.
Consider the Dark Lady; while no one knows who she was exactly, there’s general agreement that there was a Dark Lady and that Shakespeare was in love with her and wrote sonnets to/for her. Similarly, a substantial subset of the sonnets (I’m at work and don’t have time to look up specifics right now; sorry) are written to a young man and are written in praise of his beauty and perfection, &c., but are clearly not written in a woman’s voice.
Example from Sonnet 20 (linies 10-14):
Till Nature, as she wrought thee, fell a-doting,
And by addition me of thee defeated,
By adding one thing to my purpose nothing.
But since she prick’d thee out for women’s pleasure,
Mine be thy love and thy love’s use their treasure.
Clearly, this is a man, talking to a boy with whom he’s infatuated. “Dang that Nature, for making you soooo perfect and then putting a penis on you! Oh well, since you’re made for having sex with women, give your love to me and let them enjoy your passion.” (I love the phrase “prick’d thee out” in this context.)
Is he sexually infatuated with the boy? I don’t think so; I think the narrator (who, again, seems to be a pretty close analog of the author here) is in love with the boy’s perfection, and is disappointed because, being heterosexual, he can enjoy the boy’s love in every way except sexually.
I guess this begs a pretty close definition of what exactly hetero- and homosexuality are. In my mind this isn’t homosexual, but someone may come along to correct me.
For text and some commentaries (though I haven’t read closely enough to decide how much I trust the commentaries), check out:
http://www.shakespeares-sonnets.com/
In my (university) sophomore English class, we were discussing this sonnet one day…
Professor: What is the “addition” he’s talking about here?
My friend Mike, after considerable pause: A penis?
Professor: Correct.
Mike: Good, because man, I was gonna be embarrassed if that was wrong…