Penalized Langevin and Hamiltonian Monte Carlo Algorithms for Constrained Sampling