The necessity/non-necessity of baptism for salvation is an issue I’ve had to consider a couple times in the past few years. In the end, I believe that we need to consider what the ultimate purpose of baptism is in order to answer this question.
On its own, baptism, which is a physical act, cannot directly impact the immortal soul, so it must be symbolic. In my view (those of other faith traditions are free to disagree with me), baptism is basically an act of submission, a public display in which one leaves behind (by “washing away”) an old life in order to pursue a life of obedience to God alongside other believers (the Church). This is why Jesus was baptized, not because He had sins in need of forgiveness, but in order to stand before men to announce the beginning of His ministry, which was carried out in submission to the Father’s will through the empowerment of the Spirit.
Since baptism is a public declaration of submission to God’s will, I believe that while baptism is important (and often under-emphasized today), it is not absolutely necessary to enter God’s kingdom, provided the reasons are practical in nature and the believer’s life is otherwise reflective of heartfelt submission to God. By this I mean that if one was not able to be baptized before death, or else was not told that he/she ought to be baptized, it is probably not a salvation issue, whereas if one refuses to be baptized (say, out of some anti-works view of salvation that rejects baptism as “works-based” in defiance of the clear mandates of Scripture), then it may be a salvation issue because it betrays a refusal to submit to God’s stated will for believers. While I believe that baptism should shortly follow repentance whenever possible, I am not prepared to say that a sincere believer will be barred from Heaven because he/she was incapable of being baptized prior to death.
The way the thief on the cross fits into this view is that, while he was not physically baptized with water, he did, through public declaration, express faith in Christ at the very moment when such faith seemed most ridiculous. As Christ hung from the cross, naked, bloody, and dying the most torturous and humiliating of deaths ever devised, His claims to be the divine Son of God appeared more absurd than ever. And yet, the thief who knew the humiliation Christ was suffering better than anyone was prepared to sacrifice the only shred of dignity he had left and publicly profess the belief that Jesus, a crucified man, would still come into His kingdom. That is why Jesus could tell this unbaptized man, “Today you will be with me in paradise.” It’s a similar case with martyrs who, though never water-baptized, are prepared to die rather than renounce Christ; theirs is a “baptism of blood,” which is also a public declaration of faith and act of submission.
At any rate, that’s the perspective on baptism that I have found most persuasive to date. Ultimately, though, the question of how baptism/non-baptism impacts salvation is God’s issue to resolve.